This file (hdat9600_final_assignment.Rmd) is the R Markdown document in which you need to complete your HDAT9600 final assignment. This assignment is assessed and will count for 30% of the total course marks. The assignment comprises two tasks worth 15 marks each. The first task will focus on logistic regression, and the second task will focus on survival analysis. There is no word limit, but a report of about 10 pages in length when printed (except that it will not be printed) is appropriate.
Don’t hesitate to ask the course convenor for help via OpenLearning. The course instructor are happy to point you in the right direction and to make suggestions, but they won’t, of course, complete your assignments for you!
The data used for this assignment consist of records from Intensive Care Unit (ICU) hospital stays in the USA. All patients were adults who were admitted for a wide variety of reasons. ICU stays of less than 48 hours have been excluded.
The source data for the assignment are data made freely available for the 2012 MIT PhysioNet/Computing for Cardiology Challenge. Details are provided here. Training Set A data have been used. The original data has been modified and assembled to suit the purpose of this assignment. While not required for the purposes of this assignment, full details of the preparatory work can be found in the hdat9600_final_assignment_data_preparation file.
The dataframe consists of 120 variables, which are defined as follows:
Use the hyperlinks below to find out more about the clinical meaning of each variable. The first two clinical variables are summary scores that are used to assess patient condition and risk.
The following 36 clinical measures were assessed at multiple timepoints during each patient’s ICU stay. For each of the 36 clinical measures, you are given 3 summary variables: a) The minimum value during the first 24 hours in ICU (_min), b) The maximum value during the first 24 hours in ICU (_max), and c) The difference between the mean and the most extreme values during the first 24 hours in ICU (_diff). For example, for the clinical measure Cholesterol, these three variables are labelled ‘Cholesterol_min’, ‘Cholesterol_max’, and ‘Cholesterol_diff’.
The data frame can be loaded with the following code:
# import required packages
library(ggplot2)
library(gridExtra)
library(magrittr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:gridExtra':
##
## combine
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(DescTools)
library(survival)
library(eha)
library(stringi)
library(bshazard)
## Loading required package: splines
## Loading required package: Epi
library(survminer)
## Loading required package: ggpubr
# Getting the path of your current open file
# Extra code to ensure this file imports data in local directory
library(rstudioapi)
current_path <- rstudioapi::getActiveDocumentContext()$path
setwd(dirname(current_path ))
# import data
icu_patients_df0 <- readRDS("icu_patients_df0.rds")
icu_patients_df1 <- readRDS("icu_patients_df1.rds")
Note: icu_patients_df1 is an imputed (i.e. missing values are ‘derived’) version of icu_patients_df0. This assignment does not concern the methods used for imputation.
In this task, you are required to develop a logistic regression model using the icu_patients_df1 data set which adequately explains or predicts the in_hospital_death variable as the outcome using a subset of the available predictor variables. You should fit a series of models, evaluating each one, before you present your final model. Your final model should not include all the predictor variables, just a small subset of them, which you have selected based on statistical significance and/or background knowledge. It is perfectly acceptable to include predictor variables in your final model which are not statistically significant, as long as you justify their inclusion on medical or physiological grounds (you will not be marked down if your medical justification is not exactly correct or complete, but do you best). Aim for between five and ten predictor variables (slightly more or fewer is OK). You should assess each model you consider for goodness of fit and other relevant statistics to help you choose between them. For your final model, present a set of diagnostic statistics and/or charts and comment on them. You don’t need to do an exhaustive exploratory data analysis of all the variables in the data set, but you should examine those variables that you use in your model. Finally, re-fit your final model to the unimputed data frame (icu_patients_df0.rds) and comment on any differences you find compared to the same model fitted to the imputed data.
Select an initial subset of explanatory variables that you will use to predict the risk of in-hospital death. Justify your choice.
Conduct basic exploratory data analysis on your variables of choice.
Fit appropriate univariate logistic regression models.
Fit an appropriate series of multivariable logistic regression models, justifying your approach. Assess each model you consider for goodness of fit and other relevant statistics.
Present your final model. Your final model should not include all the predictor variables, just a small subset of them, which you have selected based on statistical significance and/or background knowledge.
For your final model, present a set of diagnostic statistics and/or charts and comment on them.
Write a paragraph summarising the most important findings of your final model. Include the most important values from the statistical output, and a simple clinical interpretation.
The purpose of this task is to understand the impact of information collected during the first 24 hours of an ICU stay on in-hospital mortality of the ICU population.
To select a subset of explanatory variables, we have examined the SAPS1 score and the SOFA scores included in the dataset in more detail to ascertain which variables could be logically associated with increased mortality and poor survival. We have also assessed the clinical measures used to calculate the APACHE score which is another commonly used measure in ICU risk prediction models.
SAPS1 - Simplified Acute Physiology Score is a measure of the severity of disease for patients admitted to ICU. The following measures increases the SAPS1 score:
SOFA - sequential organ failure assessment is a predictor of ICU mortality. The following measures increase the SOFA score:
The APACHE score is commonly used validated risk score for ICU risk prediction. The variables that increase the APACHE score include:
In the exploratory analysis, we include variables that will increase SOFA, SAPS or APACHE scores (note that higher SOFA, SAPS and APACHE scores are associated with higher risk of mortality). For example, increased BUN and reduced HCO3 will increase the SAPS score, therefore we will include BUN_max (but not BUN_min and BUN_diff) and HCO3_min (but not HCO3_max and HCO3_diff). Where both extremes of a variable will increase the risk score, both min and max variables will be included.
Other factors known to be associated with morbidity/ mortality not included in risk scores: * Height/ weight - Body composition/ BMI is associated with mortality and survival * Gender - Males are typically associated with high risk of mortality * Glucose - high and low Glucose levels are associated with pathology * Troponin T and I - high troponin results (cardiac biomarkers) associated with morbidity and mortality * Lactate - elevated lactate is associated with poor organ perfusion and ICU morbidity/ mortality * Albumin - reduced albumin is associated with poor clinical outcomes
Therefore, the initial subset of explanatory variables we have chosen for this task are:
DEMOGRAPHIC VARIABLES:
* Age
* Gender
* ICUType
* Height
* Length_of_stay
* Weight_max
CLINICAL VARIABLES:
* Albumin_min
* Bilirubin_max
* BUN_max
* Creatinine_max
* GCS_min
* Glucose_min and Glucose_max
* HCO3_min
* HR_min and HR_max
* K_min and K_max
* Lactate_max
* MAP_min
* Na_min and Na_max
* NISysABP_min and NISysABP_max
* Platelets_min
* FiO2_max and PaO2_min - included as PFratio= PaO2_min/ FiO2_max
* pH_min and pH_max
* RespRate_min and RespRate_max
* Temp_min and Temp_max
* TroponinI_max
* TroponinT_max
* Urine_min
* WBC_min and WBC_max
# create new variable PF ratio as part of our list of variables to include
icu_patients_df1$PFratio<-icu_patients_df1$PaO2_min/icu_patients_df1$FiO2_max
icu_patients_df0$PFratio<-icu_patients_df0$PaO2_min/icu_patients_df0$FiO2_max
# create a vector of the variables chosen to explore
explore_vars <- c('Age', 'Gender', 'ICUType', 'Height', 'Weight_max',
'Albumin_min', 'Bilirubin_max', 'BUN_max', 'Creatinine_max',
'GCS_min', 'Glucose_min', 'Glucose_max', 'HCO3_min', 'HR_min',
'HR_max', 'K_min', 'K_max', 'Lactate_max', 'Length_of_stay',
'MAP_min', 'Na_min', 'Na_max', 'NISysABP_min', 'NISysABP_max',
'Platelets_min', 'PFratio', 'pH_min', 'pH_max',
'RespRate_min', 'RespRate_max', 'Temp_min', 'Temp_max',
'TroponinI_max', 'TroponinT_max', 'Urine_min', 'WBC_min',
'WBC_max')
# examine the summary output for each chosen variable
summary(icu_patients_df1[,explore_vars])
## Age Gender ICUType
## Min. :16.00 Female: 913 Coronary Care Unit :297
## 1st Qu.:52.00 Male :1148 Cardiac Surgery Recovery Unit:448
## Median :67.00 Medical ICU :788
## Mean :64.41 Surgical ICU :528
## 3rd Qu.:78.00
## Max. :90.00
##
## Height Weight_max Albumin_min Bilirubin_max
## Min. : 13.0 Min. : 34.60 Min. :1.100 Min. : 0.100
## 1st Qu.:162.6 1st Qu.: 66.00 1st Qu.:2.600 1st Qu.: 0.400
## Median :170.2 Median : 80.00 Median :3.000 Median : 0.700
## Mean :170.0 Mean : 82.66 Mean :3.012 Mean : 1.739
## 3rd Qu.:177.8 3rd Qu.: 94.55 3rd Qu.:3.500 3rd Qu.: 1.300
## Max. :426.7 Max. :230.00 Max. :5.300 Max. :45.900
## NA's :992 NA's :146
## BUN_max Creatinine_max GCS_min Glucose_min
## Min. : 3.00 Min. : 0.200 Min. : 3.000 Min. : 24.0
## 1st Qu.: 14.00 1st Qu.: 0.800 1st Qu.: 3.000 1st Qu.: 98.0
## Median : 20.00 Median : 1.000 Median : 8.000 Median :117.0
## Mean : 27.48 Mean : 1.499 Mean : 8.773 Mean :124.8
## 3rd Qu.: 33.00 3rd Qu.: 1.500 3rd Qu.:14.000 3rd Qu.:141.0
## Max. :197.00 Max. :22.000 Max. :15.000 Max. :632.0
##
## Glucose_max HCO3_min HR_min HR_max
## Min. : 39.0 Min. : 5.00 Min. : 0.00 Min. : 44.0
## 1st Qu.: 117.0 1st Qu.:20.00 1st Qu.: 61.00 1st Qu.: 91.0
## Median : 141.0 Median :23.00 Median : 71.00 Median :104.0
## Mean : 163.3 Mean :22.43 Mean : 71.99 Mean :106.6
## 3rd Qu.: 180.0 3rd Qu.:25.00 3rd Qu.: 81.00 3rd Qu.:119.0
## Max. :1143.0 Max. :44.00 Max. :126.00 Max. :300.0
##
## K_min K_max Lactate_max Length_of_stay
## Min. :1.80 Min. : 2.500 Min. : 0.400 Min. : -1.00
## 1st Qu.:3.50 1st Qu.: 4.000 1st Qu.: 1.500 1st Qu.: 6.00
## Median :3.90 Median : 4.300 Median : 2.200 Median : 10.00
## Mean :3.95 Mean : 4.419 Mean : 2.773 Mean : 13.74
## 3rd Qu.:4.30 3rd Qu.: 4.700 3rd Qu.: 3.200 3rd Qu.: 17.00
## Max. :6.90 Max. :22.900 Max. :29.300 Max. :154.00
##
## MAP_min Na_min Na_max NISysABP_min
## Min. : 1.00 Min. : 98 Min. :112.0 Min. : 4.00
## 1st Qu.: 55.00 1st Qu.:136 1st Qu.:137.0 1st Qu.: 83.00
## Median : 61.00 Median :138 Median :140.0 Median : 95.00
## Mean : 62.76 Mean :138 Mean :139.8 Mean : 96.55
## 3rd Qu.: 70.00 3rd Qu.:141 3rd Qu.:142.0 3rd Qu.:108.00
## Max. :265.00 Max. :160 Max. :177.0 Max. :234.00
## NA's :453
## NISysABP_max Platelets_min PFratio pH_min pH_max
## Min. : 78.0 Min. : 9.0 Min. : 24 Min. :3.000 Min. :7.150
## 1st Qu.:121.0 1st Qu.:126.0 1st Qu.: 85 1st Qu.:7.280 1st Qu.:7.380
## Median :138.0 Median :184.0 Median : 122 Median :7.340 Median :7.420
## Mean :140.5 Mean :197.9 Mean : 154 Mean :7.327 Mean :7.418
## 3rd Qu.:156.0 3rd Qu.:246.0 3rd Qu.: 188 3rd Qu.:7.390 3rd Qu.:7.460
## Max. :274.0 Max. :891.0 Max. :1150 Max. :7.630 Max. :7.690
## NA's :453
## RespRate_min RespRate_max Temp_min Temp_max
## Min. : 4.00 Min. :13.00 Min. :24.20 Min. :35.40
## 1st Qu.:12.00 1st Qu.:24.00 1st Qu.:35.60 1st Qu.:37.10
## Median :14.00 Median :27.00 Median :36.10 Median :37.60
## Mean :14.25 Mean :29.12 Mean :36.01 Mean :37.69
## 3rd Qu.:17.00 3rd Qu.:33.00 3rd Qu.:36.60 3rd Qu.:38.20
## Max. :24.00 Max. :98.00 Max. :38.30 Max. :42.10
##
## TroponinI_max TroponinT_max Urine_min WBC_min
## Min. : 0.30 Min. : 0.0100 Min. : 0.00 Min. : 0.10
## 1st Qu.: 2.60 1st Qu.: 0.0600 1st Qu.: 0.00 1st Qu.: 7.60
## Median : 7.80 Median : 0.1700 Median : 20.00 Median : 10.40
## Mean :11.83 Mean : 0.9079 Mean : 34.55 Mean : 11.51
## 3rd Qu.:17.60 3rd Qu.: 0.8000 3rd Qu.: 36.00 3rd Qu.: 14.10
## Max. :43.40 Max. :24.4600 Max. :600.00 Max. :128.30
##
## WBC_max
## Min. : 0.10
## 1st Qu.: 9.30
## Median : 12.30
## Mean : 13.95
## 3rd Qu.: 16.90
## Max. :155.60
##
# Write a function to plot box plots for each variable by in_hospital_death
boxplot_eda <- function(variable){
plot <- ggplot(data=icu_patients_df1,
mapping = aes(x = in_hospital_death=="1",
y = icu_patients_df1[,variable])) +
geom_boxplot() +
labs(title=paste('Box plot of',variable),
x='In hospital death', y=variable)
return(plot)
}
# Continuous variables EDA and their interpretation
# continuous variables from the list of initial subset of explanatory variables
cont_vars <- c('Age', 'Height', 'Weight_max', 'Albumin_min', 'Bilirubin_max',
'BUN_max', 'Creatinine_max', 'GCS_min', 'Glucose_min',
'Glucose_max', 'HCO3_min', 'HR_min', 'HR_max', 'K_min', 'K_max',
'Lactate_max', 'Length_of_stay', 'MAP_min', 'Na_min', 'Na_max', 'NISysABP_min',
'NISysABP_max', 'Platelets_min', 'PFratio', 'pH_min', 'pH_max',
'RespRate_min', 'RespRate_max', 'Temp_min', 'Temp_max',
'TroponinI_max', 'TroponinT_max', 'Urine_min', 'WBC_min', 'WBC_max')
# Loop through the continuous variables and produce box plots using the boxplot_eda() function
b <- list() # initialise an empty list to store the plots in
for(i in 1:length(cont_vars)){
b[[i]] <- boxplot_eda(cont_vars[i])
}
# arrange the list of plots in a 12 row grid using grid.arrange() from package{gridExtra}
do.call(grid.arrange, c(b, nrow = 12))
## Warning: Removed 992 rows containing non-finite values (stat_boxplot).
## Warning: Removed 146 rows containing non-finite values (stat_boxplot).
## Warning: Removed 453 rows containing non-finite values (stat_boxplot).
## Warning: Removed 453 rows containing non-finite values (stat_boxplot).
# Examine SAPS1 and SOFA scores by in_hospital_death
# Given our variables were chosen based on these scores
ggplot(data=icu_patients_df1,
mapping = aes(x = in_hospital_death=="1", y = SAPS1)) + geom_boxplot() +
labs(title=paste('Box plot of SAPS1 scores'),
x='In hospital death', y='SAPS1 score')
## Warning: Removed 96 rows containing non-finite values (stat_boxplot).
ggplot(data=icu_patients_df1,
mapping = aes(x = in_hospital_death=="1", y = SOFA)) + geom_boxplot() +
labs(title=paste('Box plot of SOFA scores'),
x='In hospital death', y='SOFA score')
### Categorical variables EDA ###
# plot ICU type by in_hospital_death and change the size of the circle to represent proportion
icutype_plot <- ggplot(data=icu_patients_df1,
mapping = aes(x = in_hospital_death=="1", y = ICUType)) +
geom_count(aes(size = after_stat(prop), group = ICUType)) +
scale_size_area(max_size = 10) +
labs(title=paste('Proportion of patients by ICU type'),
x='In hospital death', size='Proportion of patients')
# plot gender by in_hospital_death and change the size of the circle to represent proportion
gender_plot <- ggplot(data=icu_patients_df1,
mapping = aes(x = in_hospital_death=="1", y = Gender)) +
geom_count(aes(size = after_stat(prop), group = ICUType)) +
scale_size_area(max_size = 20) +
labs(title=paste('Proportion of patients by gender'),
x='In hospital death', size='Proportion of patients')
# arrange the categorical variable plots side-by-side
grid.arrange(icutype_plot, gender_plot, nrow=1)
EDA Findings:
There are 2061 unique individuals in the dataset. Of these, 913 are female (44%) and 1148 are male (56%).
There were 297 deaths out of 2061 observations, which is a risk rate of 14.4% (not an uncommon event).
Medical ICU accounted for 38% of individuals, 26% in Surgical ICU, 24% in Cardiac Surgery recovery Unit and 14% in the Coronary Care unit.
The following variables have a large proportion of missing observations:
Weight_max - 146 missing observations Height - 992 missing observations NISysABP_min & NISysABP_max - 453 missing observations Length_of_stay has 24 invalid (-1) valuesProportion of in hospital deaths were observed for each variable:
# Fit univariate logistic regression for all initial selected variables
# Examine the ORs by exponentiating the coefficients of the models
# Age
age_glm <- glm(in_hospital_death ~ Age, data=icu_patients_df1, family="binomial")
summary(age_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Age, family = "binomial", data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.7522 -0.6264 -0.5111 -0.3919 2.5135
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -3.761624 0.303337 -12.401 < 2e-16 ***
## Age 0.029376 0.004229 6.947 3.73e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1644.9 on 2059 degrees of freedom
## AIC: 1648.9
##
## Number of Fisher Scoring iterations: 5
exp(coef(age_glm))
## (Intercept) Age
## 0.02324596 1.02981212
# Gender
gender_glm <- glm(in_hospital_death ~ Gender, data=icu_patients_df1, family="binomial")
summary(gender_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Gender, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.5612 -0.5612 -0.5553 -0.5553 1.9728
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.76894 0.09381 -18.856 <2e-16 ***
## GenderMale -0.02281 0.12615 -0.181 0.856
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1699.7 on 2059 degrees of freedom
## AIC: 1703.7
##
## Number of Fisher Scoring iterations: 4
exp(coef(gender_glm))
## (Intercept) GenderMale
## 0.1705128 0.9774436
# ICU type
icuType_glm <- glm(in_hospital_death ~ ICUType, data=icu_patients_df1, family="binomial")
summary(icuType_glm)
##
## Call:
## glm(formula = in_hospital_death ~ ICUType, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6402 -0.6402 -0.5615 -0.3458 2.3861
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.6463 0.1576 -10.443 < 2e-16 ***
## ICUTypeCardiac Surgery Recovery Unit -1.1407 0.2563 -4.451 8.55e-06 ***
## ICUTypeMedical ICU 0.1653 0.1824 0.906 0.365
## ICUTypeSurgical ICU -0.1214 0.2001 -0.607 0.544
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1655.3 on 2057 degrees of freedom
## AIC: 1663.3
##
## Number of Fisher Scoring iterations: 5
exp(coef(icuType_glm))
## (Intercept) ICUTypeCardiac Surgery Recovery Unit
## 0.1927711 0.3196090
## ICUTypeMedical ICU ICUTypeSurgical ICU
## 1.1797118 0.8856707
# Length of stay
los_glm <- glm(in_hospital_death ~ Length_of_stay, data=icu_patients_df1, family="binomial")
summary(los_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Length_of_stay, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.8655 -0.5594 -0.5466 -0.5413 2.0058
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.882249 0.089155 -21.112 <2e-16 ***
## Length_of_stay 0.007099 0.004331 1.639 0.101
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1697.2 on 2059 degrees of freedom
## AIC: 1701.2
##
## Number of Fisher Scoring iterations: 4
exp(coef(los_glm))
## (Intercept) Length_of_stay
## 0.1522473 1.0071239
# Weight_max
maxWeight_glm <- glm(in_hospital_death ~ Weight_max, data=icu_patients_df1, family="binomial")
summary(maxWeight_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Weight_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6460 -0.5846 -0.5605 -0.5231 2.1768
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.246092 0.242568 -5.137 2.79e-07 ***
## Weight_max -0.006212 0.002912 -2.133 0.0329 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1604.2 on 1914 degrees of freedom
## Residual deviance: 1599.4 on 1913 degrees of freedom
## (146 observations deleted due to missingness)
## AIC: 1603.4
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxWeight_glm))
## (Intercept) Weight_max
## 0.2876268 0.9938074
# Albumin_min
minAlbumin_glm <- glm(in_hospital_death ~ Albumin_min, data=icu_patients_df1, family="binomial")
summary(minAlbumin_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Albumin_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.7948 -0.5887 -0.5385 -0.4595 2.2842
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.36392 0.29389 -1.238 0.216
## Albumin_min -0.48186 0.09987 -4.825 1.4e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1676.0 on 2059 degrees of freedom
## AIC: 1680
##
## Number of Fisher Scoring iterations: 4
exp(coef(minAlbumin_glm))
## (Intercept) Albumin_min
## 0.6949487 0.6176307
# Bilirubin_max
maxBili_glm <- glm(in_hospital_death ~ Bilirubin_max, data=icu_patients_df1, family="binomial")
summary(maxBili_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Bilirubin_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.3889 -0.5421 -0.5363 -0.5321 2.0174
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.90053 0.06866 -27.679 < 2e-16 ***
## Bilirubin_max 0.05692 0.01135 5.013 5.35e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1676.8 on 2059 degrees of freedom
## AIC: 1680.8
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxBili_glm))
## (Intercept) Bilirubin_max
## 0.1494897 1.0585758
# BUN_max
maxUrea_glm <- glm(in_hospital_death ~ BUN_max, data=icu_patients_df1, family="binomial")
summary(maxUrea_glm)
##
## Call:
## glm(formula = in_hospital_death ~ BUN_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.0462 -0.5269 -0.4789 -0.4443 2.2309
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.492189 0.103693 -24.034 <2e-16 ***
## BUN_max 0.022610 0.002347 9.634 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1607.3 on 2059 degrees of freedom
## AIC: 1611.3
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxUrea_glm))
## (Intercept) BUN_max
## 0.08272864 1.02286736
# Creatinine_max
maxCr_glm <- glm(in_hospital_death ~ Creatinine_max, data=icu_patients_df1, family="binomial")
summary(maxCr_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Creatinine_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.8627 -0.5433 -0.5270 -0.5151 2.0633
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.05087 0.08430 -24.328 < 2e-16 ***
## Creatinine_max 0.16325 0.03135 5.208 1.91e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1674.4 on 2059 degrees of freedom
## AIC: 1678.4
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxCr_glm))
## (Intercept) Creatinine_max
## 0.1286229 1.1773361
# GCS_min
minGCS_glm <- glm(in_hospital_death ~ GCS_min, data=icu_patients_df1, family="binomial")
summary(minGCS_glm)
##
## Call:
## glm(formula = in_hospital_death ~ GCS_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6238 -0.6238 -0.5394 -0.4853 2.0964
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.40261 0.12298 -11.405 < 2e-16 ***
## GCS_min -0.04514 0.01317 -3.426 0.000612 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1687.7 on 2059 degrees of freedom
## AIC: 1691.7
##
## Number of Fisher Scoring iterations: 4
exp(coef(minGCS_glm))
## (Intercept) GCS_min
## 0.2459539 0.9558636
# Glucose_min
minGlu_glm <- glm(in_hospital_death ~ Glucose_min, data=icu_patients_df1, family="binomial")
summary(minGlu_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Glucose_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.7799 -0.5613 -0.5522 -0.5428 2.0271
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.967537 0.171241 -11.490 <2e-16 ***
## Glucose_min 0.001476 0.001253 1.178 0.239
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1698.4 on 2059 degrees of freedom
## AIC: 1702.4
##
## Number of Fisher Scoring iterations: 4
exp(coef(minGlu_glm))
## (Intercept) Glucose_min
## 0.1398007 1.0014773
# Glucose_max
maxGlu_glm <- glm(in_hospital_death ~ Glucose_max, data=icu_patients_df1, family="binomial")
summary(maxGlu_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Glucose_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4117 -0.5572 -0.5343 -0.5162 2.0872
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.1865370 0.1202802 -18.179 < 2e-16 ***
## Glucose_max 0.0023817 0.0005819 4.093 4.25e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1684.2 on 2059 degrees of freedom
## AIC: 1688.2
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxGlu_glm))
## (Intercept) Glucose_max
## 0.112305 1.002385
# HCO3_min
minHCO3_glm <- glm(in_hospital_death ~ HCO3_min, data=icu_patients_df1, family="binomial")
summary(minHCO3_glm)
##
## Call:
## glm(formula = in_hospital_death ~ HCO3_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.9781 -0.5748 -0.5165 -0.4634 2.6504
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.10497 0.29323 -0.358 0.72
## HCO3_min -0.07675 0.01345 -5.705 1.17e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1666.8 on 2059 degrees of freedom
## AIC: 1670.8
##
## Number of Fisher Scoring iterations: 4
exp(coef(minHCO3_glm))
## (Intercept) HCO3_min
## 0.9003521 0.9261197
# HR_min
minHR_glm <- glm(in_hospital_death ~ HR_min, data=icu_patients_df1, family="binomial")
summary(minHR_glm)
##
## Call:
## glm(formula = in_hospital_death ~ HR_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6235 -0.5656 -0.5528 -0.5390 2.1087
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.108733 0.301434 -6.996 2.64e-12 ***
## HR_min 0.004520 0.004052 1.115 0.265
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1698.4 on 2059 degrees of freedom
## AIC: 1702.4
##
## Number of Fisher Scoring iterations: 4
exp(coef(minHR_glm))
## (Intercept) HR_min
## 0.1213916 1.0045299
# HR_max
maxHR_glm <- glm(in_hospital_death ~ HR_max, data=icu_patients_df1, family="binomial")
summary(maxHR_glm)
##
## Call:
## glm(formula = in_hospital_death ~ HR_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.1194 -0.5733 -0.5402 -0.5067 2.1517
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.707555 0.303251 -8.928 < 2e-16 ***
## HR_max 0.008565 0.002707 3.164 0.00156 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1689.9 on 2059 degrees of freedom
## AIC: 1693.9
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxHR_glm))
## (Intercept) HR_max
## 0.06669966 1.00860172
# K_min
minK_glm <- glm(in_hospital_death ~ K_min, data=icu_patients_df1, family="binomial")
summary(minK_glm)
##
## Call:
## glm(formula = in_hospital_death ~ K_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6024 -0.5647 -0.5546 -0.5447 2.0345
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.47413 0.42361 -3.480 0.000502 ***
## K_min -0.07804 0.10660 -0.732 0.464083
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1699.1 on 2059 degrees of freedom
## AIC: 1703.1
##
## Number of Fisher Scoring iterations: 4
exp(coef(minK_glm))
## (Intercept) K_min
## 0.2289787 0.9249235
# K_max
maxK_glm <- glm(in_hospital_death ~ K_max, data=icu_patients_df1, family="binomial")
summary(maxK_glm)
##
## Call:
## glm(formula = in_hospital_death ~ K_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.2402 -0.5620 -0.5512 -0.5380 2.0561
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.24634 0.28233 -7.956 1.77e-15 ***
## K_max 0.10449 0.06153 1.698 0.0895 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1697.0 on 2059 degrees of freedom
## AIC: 1701
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxK_glm))
## (Intercept) K_max
## 0.1057861 1.1101406
# Lactate_max
maxLactate_glm <- glm(in_hospital_death ~ Lactate_max, data=icu_patients_df1, family="binomial")
summary(maxLactate_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Lactate_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.1726 -0.5544 -0.5200 -0.4939 2.1212
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.1932 0.1005 -21.820 < 2e-16 ***
## Lactate_max 0.1372 0.0244 5.625 1.86e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1669.5 on 2059 degrees of freedom
## AIC: 1673.5
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxLactate_glm))
## (Intercept) Lactate_max
## 0.1115536 1.1470953
# MAP_min
minMAP_glm <- glm(in_hospital_death ~ MAP_min, data=icu_patients_df1, family="binomial")
summary(minMAP_glm)
##
## Call:
## glm(formula = in_hospital_death ~ MAP_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6583 -0.5674 -0.5551 -0.5341 2.4214
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.413112 0.257434 -5.489 4.04e-08 ***
## MAP_min -0.005926 0.004051 -1.463 0.143
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1697.4 on 2059 degrees of freedom
## AIC: 1701.4
##
## Number of Fisher Scoring iterations: 4
exp(coef(minMAP_glm))
## (Intercept) MAP_min
## 0.2433846 0.9940913
# Na_min
minNa_glm <- glm(in_hospital_death ~ Na_min, data=icu_patients_df1, family="binomial")
summary(minNa_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Na_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.9061 -0.5706 -0.5490 -0.5282 2.2298
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.04227 1.79129 1.140 0.2542
## Na_min -0.02776 0.01301 -2.133 0.0329 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1695.3 on 2059 degrees of freedom
## AIC: 1699.3
##
## Number of Fisher Scoring iterations: 4
exp(coef(minNa_glm))
## (Intercept) Na_min
## 7.7080596 0.9726239
# Na_max
maxNa_glm <- glm(in_hospital_death ~ Na_max, data=icu_patients_df1, family="binomial")
summary(maxNa_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Na_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6176 -0.5615 -0.5573 -0.5491 2.0760
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.664686 1.927556 -0.345 0.730
## Na_max -0.007993 0.013793 -0.580 0.562
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1699.4 on 2059 degrees of freedom
## AIC: 1703.4
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxNa_glm))
## (Intercept) Na_max
## 0.5144348 0.9920384
# NISysABP_min
minNISys_ABP_glm <- glm(in_hospital_death ~ NISysABP_min, data=icu_patients_df1, family="binomial")
summary(minNISys_ABP_glm)
##
## Call:
## glm(formula = in_hospital_death ~ NISysABP_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.9728 -0.6135 -0.5731 -0.5005 2.3871
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.450605 0.328983 -1.370 0.170783
## NISysABP_min -0.012922 0.003466 -3.728 0.000193 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1403.1 on 1607 degrees of freedom
## Residual deviance: 1388.5 on 1606 degrees of freedom
## (453 observations deleted due to missingness)
## AIC: 1392.5
##
## Number of Fisher Scoring iterations: 4
exp(coef(minNISys_ABP_glm))
## (Intercept) NISysABP_min
## 0.6372422 0.9871616
# NISysABP_max
maxNISys_ABP_glm <- glm(in_hospital_death ~ NISysABP_max, data=icu_patients_df1, family="binomial")
summary(maxNISys_ABP_glm)
##
## Call:
## glm(formula = in_hospital_death ~ NISysABP_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6098 -0.5886 -0.5846 -0.5799 1.9414
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.7826689 0.3544507 -5.029 4.92e-07 ***
## NISysABP_max 0.0007759 0.0024679 0.314 0.753
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1403.1 on 1607 degrees of freedom
## Residual deviance: 1403.0 on 1606 degrees of freedom
## (453 observations deleted due to missingness)
## AIC: 1407
##
## Number of Fisher Scoring iterations: 3
exp(coef(maxNISys_ABP_glm))
## (Intercept) NISysABP_max
## 0.1681887 1.0007762
# Platelets_min
minPlt_glm <- glm(in_hospital_death ~ Platelets_min, data=icu_patients_df1, family="binomial")
summary(minPlt_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Platelets_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6122 -0.5735 -0.5558 -0.5260 2.2141
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.5693181 0.1352494 -11.603 <2e-16 ***
## Platelets_min -0.0010963 0.0006322 -1.734 0.0829 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1696.6 on 2059 degrees of freedom
## AIC: 1700.6
##
## Number of Fisher Scoring iterations: 4
exp(coef(minPlt_glm))
## (Intercept) Platelets_min
## 0.2081871 0.9989043
# PFratio
maxPFratio_glm <- glm(in_hospital_death ~ PFratio, data=icu_patients_df1, family="binomial")
summary(maxPFratio_glm)
##
## Call:
## glm(formula = in_hospital_death ~ PFratio, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.5806 -0.5687 -0.5595 -0.5398 2.1022
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.6790207 0.1148206 -14.623 <2e-16 ***
## PFratio -0.0006772 0.0006452 -1.049 0.294
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1698.5 on 2059 degrees of freedom
## AIC: 1702.5
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxPFratio_glm))
## (Intercept) PFratio
## 0.1865566 0.9993231
# pH_min
minpH_glm <- glm(in_hospital_death ~ pH_min, data=icu_patients_df1, family="binomial")
summary(minpH_glm)
##
## Call:
## glm(formula = in_hospital_death ~ pH_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.9980 -0.5733 -0.5358 -0.4868 2.2874
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 19.5912 4.8996 3.998 6.37e-05 ***
## pH_min -2.9197 0.6699 -4.358 1.31e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1677.4 on 2059 degrees of freedom
## AIC: 1681.4
##
## Number of Fisher Scoring iterations: 4
exp(coef(minpH_glm))
## (Intercept) pH_min
## 3.223597e+08 5.395008e-02
# pH_max
maxpH_glm <- glm(in_hospital_death ~ pH_max, data=icu_patients_df1, family="binomial")
summary(maxpH_glm)
##
## Call:
## glm(formula = in_hospital_death ~ pH_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6684 -0.5677 -0.5523 -0.5297 2.0743
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 9.3001 7.0197 1.325 0.185
## pH_max -1.4944 0.9469 -1.578 0.115
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1697.2 on 2059 degrees of freedom
## AIC: 1701.2
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxpH_glm))
## (Intercept) pH_max
## 10939.130618 0.224379
# RespRate_min
minRR_glm <- glm(in_hospital_death ~ RespRate_min, data=icu_patients_df1, family="binomial")
summary(minRR_glm)
##
## Call:
## glm(formula = in_hospital_death ~ RespRate_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.7929 -0.5872 -0.5222 -0.4636 2.3445
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -3.01958 0.25802 -11.703 < 2e-16 ***
## RespRate_min 0.08432 0.01656 5.091 3.57e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1673.6 on 2059 degrees of freedom
## AIC: 1677.6
##
## Number of Fisher Scoring iterations: 4
exp(coef(minRR_glm))
## (Intercept) RespRate_min
## 0.04882193 1.08797694
# RespRate_max
maxRR_glm <- glm(in_hospital_death ~ RespRate_max, data=icu_patients_df1, family="binomial")
summary(maxRR_glm)
##
## Call:
## glm(formula = in_hospital_death ~ RespRate_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.4489 -0.5679 -0.5233 -0.4817 2.1771
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -2.835656 0.235885 -12.021 < 2e-16 ***
## RespRate_max 0.035250 0.007412 4.756 1.98e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1677.8 on 2059 degrees of freedom
## AIC: 1681.8
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxRR_glm))
## (Intercept) RespRate_max
## 0.05868003 1.03587901
# Temp_min
minTemp_glm <- glm(in_hospital_death ~ Temp_min, data=icu_patients_df1, family="binomial")
summary(minTemp_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Temp_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.8918 -0.5741 -0.5409 -0.4973 2.2040
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 7.4599 2.3473 3.178 0.00148 **
## Temp_min -0.2571 0.0654 -3.931 8.45e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1684.3 on 2059 degrees of freedom
## AIC: 1688.3
##
## Number of Fisher Scoring iterations: 4
exp(coef(minTemp_glm))
## (Intercept) Temp_min
## 1737.0475612 0.7732712
# Temp_max
maxTemp_glm <- glm(in_hospital_death ~ Temp_max, data=icu_patients_df1, family="binomial")
summary(maxTemp_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Temp_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6077 -0.5689 -0.5549 -0.5366 2.1386
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.60419 3.08152 0.521 0.603
## Temp_max -0.08988 0.08183 -1.098 0.272
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1698.5 on 2059 degrees of freedom
## AIC: 1702.5
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxTemp_glm))
## (Intercept) Temp_max
## 4.9738416 0.9140428
# TroponinI_max
maxTropI_glm <- glm(in_hospital_death ~ TroponinI_max, data=icu_patients_df1, family="binomial")
summary(maxTropI_glm)
##
## Call:
## glm(formula = in_hospital_death ~ TroponinI_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.5736 -0.5688 -0.5565 -0.5350 2.0415
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.719798 0.090789 -18.943 <2e-16 ***
## TroponinI_max -0.005329 0.005774 -0.923 0.356
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1698.8 on 2059 degrees of freedom
## AIC: 1702.8
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxTropI_glm))
## (Intercept) TroponinI_max
## 0.1791023 0.9946850
# TroponinT_max
maxTropT_glm <- glm(in_hospital_death ~ TroponinT_max, data=icu_patients_df1, family="binomial")
summary(maxTropT_glm)
##
## Call:
## glm(formula = in_hospital_death ~ TroponinT_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.0740 -0.5503 -0.5430 -0.5416 1.9965
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.84719 0.06917 -26.705 <2e-16 ***
## TroponinT_max 0.06537 0.02638 2.478 0.0132 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1694.1 on 2059 degrees of freedom
## AIC: 1698.1
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxTropT_glm))
## (Intercept) TroponinT_max
## 0.1576799 1.0675579
# Urine_min
minUrine_glm <- glm(in_hospital_death ~ Urine_min, data=icu_patients_df1, family="binomial")
summary(minUrine_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Urine_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -0.6034 -0.5952 -0.5631 -0.5105 2.9438
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.610937 0.076052 -21.182 < 2e-16 ***
## Urine_min -0.006020 0.001787 -3.369 0.000756 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1683.1 on 2059 degrees of freedom
## AIC: 1687.1
##
## Number of Fisher Scoring iterations: 5
exp(coef(minUrine_glm))
## (Intercept) Urine_min
## 0.1997003 0.9939986
# WBC_min
minWBC_glm <- glm(in_hospital_death ~ WBC_min, data=icu_patients_df1, family="binomial")
summary(minWBC_glm)
##
## Call:
## glm(formula = in_hospital_death ~ WBC_min, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.2861 -0.5638 -0.5477 -0.5315 2.0563
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.987167 0.119356 -16.649 <2e-16 ***
## WBC_min 0.017452 0.008437 2.068 0.0386 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1695.6 on 2059 degrees of freedom
## AIC: 1699.6
##
## Number of Fisher Scoring iterations: 4
exp(coef(minWBC_glm))
## (Intercept) WBC_min
## 0.1370832 1.0176047
# WBC_max
maxWBC_glm <- glm(in_hospital_death ~ WBC_max, data=icu_patients_df1, family="binomial")
summary(maxWBC_glm)
##
## Call:
## glm(formula = in_hospital_death ~ WBC_max, family = "binomial",
## data = icu_patients_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.2674 -0.5631 -0.5475 -0.5326 2.0545
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.982652 0.118080 -16.791 <2e-16 ***
## WBC_max 0.014086 0.006859 2.054 0.04 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1699.7 on 2060 degrees of freedom
## Residual deviance: 1695.7 on 2059 degrees of freedom
## AIC: 1699.7
##
## Number of Fisher Scoring iterations: 4
exp(coef(maxWBC_glm))
## (Intercept) WBC_max
## 0.1377035 1.0141855
Univariate Models Findings:
On univariate analysis using logistic regression, the following variables of the initial selected subset had a significant effect on the in_hospital_death binary outcome (i.e. the null hypothesis of no effect was rejected with a Wald statistic p-value (Pr(>|z|)) < 0.05):
Age (OR: 1.03; p < 0.001) ICUType - Cardiac Surgery Recovery Unit (compared to Coronary Care Unit) OR: 0.32; p < 0.001 Weight_max (OR: 0.99; p = 0.03) Albumin_min (OR: 0.62; p < 0.001) Bilirubin_max (OR: 1.06; p < 0.001) BUN_max (OR: 1.02; p < 0.001) Creatinine_max (OR: 1.18; p < 0.001) GCS_min (OR: 0.96; p < 0.001) Glucose_max (OR: 1.00; p < 0.001) HCO3_min (OR: 0.93; p < 0.001) HR_max (OR: 1.01; p = 0.002) Lactate_max (OR: 1.15; p < 0.001) Na_min (OR: 0.97; p = 0.03) NISysABP_min (OR: 0.99; p < 0.001) pH_min (OR: 0.05; p < 0.001) RespRate_min (OR: 1.09; p < 0.001) RespRate_max (OR: 1.04; p < 0.001) Temp_min (OR: 0.77; p < 0.001) TroponinT_max (OR: 1.07; p = 0.01) Urine_min (OR: 0.99; p < 0.001) WBC_min (OR: 1.02; p = 0.04) WBC_max (OR: 1.01; p = 0.04) Interestingly, we see some values have an odds ratio that reduces risk of in_hospital_death i.e. OR < 1. At first glance, these seem counter-intuitive. For example, clinically, we expect those with low albumin (lower protein) to be associated with poorer outcomes than those with normal albumin levels; however, the OR for Albumin_min is 0.62. This does not mean that having low albumin reduces one’s risk of in_hospital_death, rather, it should be interpreted as ‘those with larger values of Albumin_min are less likely to die in hospital than those with lower values of Albumin_min’; i.e. those with a ‘less low’ or ‘higher’ Albumin_min value will fare better. Similar results can be seen on univariate analysis for GCS_min, HCO3_min, Na_min, NISysABP_min, Temp_min and Urine_min.
Variables without a significant effect on in_hospital_death are:
Gender Length_of_stay Glucose_min HR_min K_min K_max MAP_min Na_max NISysABP_max Platelets_min PFratio pH_max Temp_max TroponinI_max ## Create a dataset without missing or invalid data to use to build the model ##
## in order to remain consistent and allow comparisons between models to be made ##
# Check counts of missing data in each variable
for(i in 1:length(colnames(icu_patients_df1))){
print(c(i,colnames(icu_patients_df1[i]), sum(is.na(icu_patients_df1[i]))))
}
## [1] "1" "RecordID" "0"
## [1] "2" "Length_of_stay" "0"
## [1] "3" "SAPS1" "96"
## [1] "4" "SOFA" "0"
## [1] "5" "Survival" "1288"
## [1] "6" "in_hospital_death" "0"
## [1] "7" "Days" "0"
## [1] "8" "Status" "0"
## [1] "9" "Age" "0"
## [1] "10" "Albumin_diff" "0"
## [1] "11" "Albumin_max" "0"
## [1] "12" "Albumin_min" "0"
## [1] "13" "ALP_diff" "0"
## [1] "14" "ALP_max" "0"
## [1] "15" "ALP_min" "0"
## [1] "16" "ALT_diff" "0"
## [1] "17" "ALT_max" "0"
## [1] "18" "ALT_min" "0"
## [1] "19" "AST_diff" "0"
## [1] "20" "AST_max" "0"
## [1] "21" "AST_min" "0"
## [1] "22" "Bilirubin_diff" "0"
## [1] "23" "Bilirubin_max" "0"
## [1] "24" "Bilirubin_min" "0"
## [1] "25" "BUN_diff" "0"
## [1] "26" "BUN_max" "0"
## [1] "27" "BUN_min" "0"
## [1] "28" "Cholesterol_diff" "0"
## [1] "29" "Cholesterol_max" "0"
## [1] "30" "Cholesterol_min" "0"
## [1] "31" "Creatinine_diff" "0"
## [1] "32" "Creatinine_max" "0"
## [1] "33" "Creatinine_min" "0"
## [1] "34" "DiasABP_diff" "715"
## [1] "35" "DiasABP_max" "715"
## [1] "36" "DiasABP_min" "715"
## [1] "37" "FiO2_diff" "0"
## [1] "38" "FiO2_max" "0"
## [1] "39" "FiO2_min" "0"
## [1] "40" "GCS_diff" "0"
## [1] "41" "GCS_max" "0"
## [1] "42" "GCS_min" "0"
## [1] "43" "Gender" "0"
## [1] "44" "Glucose_diff" "0"
## [1] "45" "Glucose_max" "0"
## [1] "46" "Glucose_min" "0"
## [1] "47" "HCO3_diff" "0"
## [1] "48" "HCO3_max" "0"
## [1] "49" "HCO3_min" "0"
## [1] "50" "HCT_diff" "0"
## [1] "51" "HCT_max" "0"
## [1] "52" "HCT_min" "0"
## [1] "53" "Height" "992"
## [1] "54" "HR_diff" "0"
## [1] "55" "HR_max" "0"
## [1] "56" "HR_min" "0"
## [1] "57" "ICUType" "0"
## [1] "58" "K_diff" "0"
## [1] "59" "K_max" "0"
## [1] "60" "K_min" "0"
## [1] "61" "Lactate_diff" "0"
## [1] "62" "Lactate_max" "0"
## [1] "63" "Lactate_min" "0"
## [1] "64" "MAP_diff" "0"
## [1] "65" "MAP_max" "0"
## [1] "66" "MAP_min" "0"
## [1] "67" "Mg_diff" "0"
## [1] "68" "Mg_max" "0"
## [1] "69" "Mg_min" "0"
## [1] "70" "Na_diff" "0"
## [1] "71" "Na_max" "0"
## [1] "72" "Na_min" "0"
## [1] "73" "NIDiasABP_diff" "455"
## [1] "74" "NIDiasABP_max" "455"
## [1] "75" "NIDiasABP_min" "455"
## [1] "76" "NIMAP_diff" "455"
## [1] "77" "NIMAP_max" "455"
## [1] "78" "NIMAP_min" "455"
## [1] "79" "NISysABP_diff" "453"
## [1] "80" "NISysABP_max" "453"
## [1] "81" "NISysABP_min" "453"
## [1] "82" "PaCO2_diff" "0"
## [1] "83" "PaCO2_max" "0"
## [1] "84" "PaCO2_min" "0"
## [1] "85" "PaO2_diff" "0"
## [1] "86" "PaO2_max" "0"
## [1] "87" "PaO2_min" "0"
## [1] "88" "pH_diff" "0"
## [1] "89" "pH_max" "0"
## [1] "90" "pH_min" "0"
## [1] "91" "Platelets_diff" "0"
## [1] "92" "Platelets_max" "0"
## [1] "93" "Platelets_min" "0"
## [1] "94" "RespRate_diff" "0"
## [1] "95" "RespRate_max" "0"
## [1] "96" "RespRate_min" "0"
## [1] "97" "SaO2_diff" "0"
## [1] "98" "SaO2_max" "0"
## [1] "99" "SaO2_min" "0"
## [1] "100" "SysABP_diff" "715"
## [1] "101" "SysABP_max" "715"
## [1] "102" "SysABP_min" "715"
## [1] "103" "Temp_diff" "0"
## [1] "104" "Temp_max" "0"
## [1] "105" "Temp_min" "0"
## [1] "106" "TroponinI_diff" "0"
## [1] "107" "TroponinI_max" "0"
## [1] "108" "TroponinI_min" "0"
## [1] "109" "TroponinT_diff" "0"
## [1] "110" "TroponinT_max" "0"
## [1] "111" "TroponinT_min" "0"
## [1] "112" "Urine_diff" "0"
## [1] "113" "Urine_max" "0"
## [1] "114" "Urine_min" "0"
## [1] "115" "WBC_diff" "0"
## [1] "116" "WBC_max" "0"
## [1] "117" "WBC_min" "0"
## [1] "118" "Weight_diff" "146"
## [1] "119" "Weight_max" "146"
## [1] "120" "Weight_min" "146"
## [1] "121" "PFratio" "0"
## Result: of the variables chosen to explore for the survival model, large amounts of missing data in:
## Height (992), NISysABP_min (453), NISysABP_max (453), Weight_max (146)
## Decision: include Weight_max; remove Height, NISysABP_min, NISysABP_max
# Check counts of negative data (noted some -1 values) in each variable
for(i in 1:length(colnames(icu_patients_df1))){
print(c(i,colnames(icu_patients_df1[i]), sum(icu_patients_df1[i] < 0)))
}
## [1] "1" "RecordID" "0"
## [1] "2" "Length_of_stay" "25"
## [1] "3" "SAPS1" NA
## [1] "4" "SOFA" "65"
## [1] "5" "Survival" NA
## [1] "6" "in_hospital_death" "0"
## [1] "7" "Days" "0"
## [1] "8" "Status" "0"
## [1] "9" "Age" "0"
## [1] "10" "Albumin_diff" "0"
## [1] "11" "Albumin_max" "0"
## [1] "12" "Albumin_min" "0"
## [1] "13" "ALP_diff" "0"
## [1] "14" "ALP_max" "0"
## [1] "15" "ALP_min" "0"
## [1] "16" "ALT_diff" "0"
## [1] "17" "ALT_max" "0"
## [1] "18" "ALT_min" "0"
## [1] "19" "AST_diff" "0"
## [1] "20" "AST_max" "0"
## [1] "21" "AST_min" "0"
## [1] "22" "Bilirubin_diff" "0"
## [1] "23" "Bilirubin_max" "0"
## [1] "24" "Bilirubin_min" "0"
## [1] "25" "BUN_diff" "0"
## [1] "26" "BUN_max" "0"
## [1] "27" "BUN_min" "0"
## [1] "28" "Cholesterol_diff" "0"
## [1] "29" "Cholesterol_max" "0"
## [1] "30" "Cholesterol_min" "0"
## [1] "31" "Creatinine_diff" "0"
## [1] "32" "Creatinine_max" "0"
## [1] "33" "Creatinine_min" "0"
## [1] "34" "DiasABP_diff" NA
## [1] "35" "DiasABP_max" NA
## [1] "36" "DiasABP_min" NA
## [1] "37" "FiO2_diff" "0"
## [1] "38" "FiO2_max" "0"
## [1] "39" "FiO2_min" "0"
## [1] "40" "GCS_diff" "0"
## [1] "41" "GCS_max" "0"
## [1] "42" "GCS_min" "0"
## Warning in Ops.factor(left, right): '<' not meaningful for factors
## [1] "43" "Gender" NA
## [1] "44" "Glucose_diff" "0"
## [1] "45" "Glucose_max" "0"
## [1] "46" "Glucose_min" "0"
## [1] "47" "HCO3_diff" "0"
## [1] "48" "HCO3_max" "0"
## [1] "49" "HCO3_min" "0"
## [1] "50" "HCT_diff" "0"
## [1] "51" "HCT_max" "0"
## [1] "52" "HCT_min" "0"
## [1] "53" "Height" NA
## [1] "54" "HR_diff" "0"
## [1] "55" "HR_max" "0"
## [1] "56" "HR_min" "0"
## Warning in Ops.factor(left, right): '<' not meaningful for factors
## [1] "57" "ICUType" NA
## [1] "58" "K_diff" "0"
## [1] "59" "K_max" "0"
## [1] "60" "K_min" "0"
## [1] "61" "Lactate_diff" "0"
## [1] "62" "Lactate_max" "0"
## [1] "63" "Lactate_min" "0"
## [1] "64" "MAP_diff" "0"
## [1] "65" "MAP_max" "0"
## [1] "66" "MAP_min" "0"
## [1] "67" "Mg_diff" "0"
## [1] "68" "Mg_max" "0"
## [1] "69" "Mg_min" "0"
## [1] "70" "Na_diff" "0"
## [1] "71" "Na_max" "0"
## [1] "72" "Na_min" "0"
## [1] "73" "NIDiasABP_diff" NA
## [1] "74" "NIDiasABP_max" NA
## [1] "75" "NIDiasABP_min" NA
## [1] "76" "NIMAP_diff" NA
## [1] "77" "NIMAP_max" NA
## [1] "78" "NIMAP_min" NA
## [1] "79" "NISysABP_diff" NA
## [1] "80" "NISysABP_max" NA
## [1] "81" "NISysABP_min" NA
## [1] "82" "PaCO2_diff" "0"
## [1] "83" "PaCO2_max" "0"
## [1] "84" "PaCO2_min" "0"
## [1] "85" "PaO2_diff" "0"
## [1] "86" "PaO2_max" "0"
## [1] "87" "PaO2_min" "0"
## [1] "88" "pH_diff" "0"
## [1] "89" "pH_max" "0"
## [1] "90" "pH_min" "0"
## [1] "91" "Platelets_diff" "0"
## [1] "92" "Platelets_max" "0"
## [1] "93" "Platelets_min" "0"
## [1] "94" "RespRate_diff" "0"
## [1] "95" "RespRate_max" "0"
## [1] "96" "RespRate_min" "0"
## [1] "97" "SaO2_diff" "0"
## [1] "98" "SaO2_max" "0"
## [1] "99" "SaO2_min" "0"
## [1] "100" "SysABP_diff" NA
## [1] "101" "SysABP_max" NA
## [1] "102" "SysABP_min" NA
## [1] "103" "Temp_diff" "0"
## [1] "104" "Temp_max" "0"
## [1] "105" "Temp_min" "0"
## [1] "106" "TroponinI_diff" "0"
## [1] "107" "TroponinI_max" "0"
## [1] "108" "TroponinI_min" "0"
## [1] "109" "TroponinT_diff" "0"
## [1] "110" "TroponinT_max" "0"
## [1] "111" "TroponinT_min" "0"
## [1] "112" "Urine_diff" "0"
## [1] "113" "Urine_max" "0"
## [1] "114" "Urine_min" "0"
## [1] "115" "WBC_diff" "0"
## [1] "116" "WBC_max" "0"
## [1] "117" "WBC_min" "0"
## [1] "118" "Weight_diff" NA
## [1] "119" "Weight_max" NA
## [1] "120" "Weight_min" NA
## [1] "121" "PFratio" "0"
## Result: negative values in Length_of_stay and SOFA
# Create a new dataset with the only non-missing data from list of initial variables chosen
# (excluding those with very high missingness i.e. Height, NISysABP_min, NISysABP_max)
nm_icu_model_df1 <- na.omit(subset(icu_patients_df1,
select=c(Days, Status, # the survival object variables (for task 2)
RecordID, # keep record id for reference if needed
in_hospital_death, # for task 1
Age, Gender, ICUType, Weight_max,
Albumin_min, Bilirubin_max,
BUN_max, Creatinine_max,
GCS_max, Glucose_min, Glucose_max,
HCO3_min, HR_min, HR_max, K_min,
K_max, Lactate_max, Length_of_stay, MAP_min, Na_min,
Na_max, Platelets_min, PFratio, pH_min,
pH_max, RespRate_min, RespRate_max,
Temp_min, Temp_max, TroponinT_max,
TroponinI_max, Urine_min, WBC_min, WBC_max)))
# Also exclude the negative data in Length_of_stay
nm_icu_model_df1 <- nm_icu_model_df1[nm_icu_model_df1$Length_of_stay>=0,]
# Fit a multivariable glm to predict in_hospital_death using
# all variables from initially selected predictors
full_glm <- glm(in_hospital_death ~
Age +
Gender +
ICUType +
Weight_max +
Albumin_min +
Bilirubin_max +
BUN_max +
Creatinine_max +
GCS_max +
Glucose_min +
Glucose_max +
HCO3_min +
HR_min +
HR_max +
K_min +
K_max +
Lactate_max +
Length_of_stay +
MAP_min +
Na_min +
Na_max +
Platelets_min +
PFratio +
pH_min +
pH_max +
RespRate_min +
RespRate_max +
Temp_min +
Temp_max +
TroponinT_max +
TroponinI_max +
Urine_min +
WBC_min +
WBC_max
, data=nm_icu_model_df1, family="binomial")
summary(full_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Age + Gender + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min +
## HR_max + K_min + K_max + Lactate_max + Length_of_stay + MAP_min +
## Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max +
## RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max +
## TroponinI_max + Urine_min + WBC_min + WBC_max, family = "binomial",
## data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9331 -0.5387 -0.3378 -0.1813 3.1644
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 2.464e+01 1.104e+01 2.232 0.025584 *
## Age 3.546e-02 5.589e-03 6.345 2.22e-10 ***
## GenderMale -1.662e-02 1.591e-01 -0.104 0.916836
## ICUTypeCardiac Surgery Recovery Unit -1.197e+00 3.331e-01 -3.595 0.000325 ***
## ICUTypeMedical ICU 1.635e-01 2.315e-01 0.706 0.480121
## ICUTypeSurgical ICU 1.986e-01 2.596e-01 0.765 0.444203
## Weight_max -4.419e-03 3.736e-03 -1.183 0.236871
## Albumin_min -3.210e-01 1.278e-01 -2.511 0.012031 *
## Bilirubin_max 3.910e-02 1.464e-02 2.670 0.007582 **
## BUN_max 2.206e-02 4.193e-03 5.260 1.44e-07 ***
## Creatinine_max -5.386e-02 5.669e-02 -0.950 0.342061
## GCS_max -1.939e-01 2.683e-02 -7.228 4.92e-13 ***
## Glucose_min 6.949e-04 1.772e-03 0.392 0.694955
## Glucose_max 6.603e-04 1.013e-03 0.652 0.514389
## HCO3_min 1.024e-02 1.851e-02 0.553 0.580281
## HR_min 1.106e-02 5.807e-03 1.904 0.056931 .
## HR_max 4.434e-03 3.884e-03 1.142 0.253592
## K_min -8.617e-02 1.608e-01 -0.536 0.592139
## K_max -7.020e-02 9.958e-02 -0.705 0.480872
## Lactate_max 6.564e-02 3.681e-02 1.783 0.074547 .
## Length_of_stay -5.640e-03 5.953e-03 -0.947 0.343453
## MAP_min -8.458e-05 4.375e-03 -0.019 0.984577
## Na_min 3.908e-03 3.550e-02 0.110 0.912335
## Na_max -6.628e-02 3.591e-02 -1.846 0.064911 .
## Platelets_min -1.120e-03 8.174e-04 -1.370 0.170705
## PFratio -7.012e-05 7.999e-04 -0.088 0.930150
## pH_min -1.184e+00 9.377e-01 -1.263 0.206658
## pH_max -2.781e-01 1.416e+00 -0.196 0.844268
## RespRate_min -2.327e-02 2.553e-02 -0.912 0.361906
## RespRate_max 1.552e-02 1.234e-02 1.258 0.208526
## Temp_min -1.807e-01 8.750e-02 -2.065 0.038936 *
## Temp_max -1.870e-02 1.065e-01 -0.176 0.860592
## TroponinT_max 1.800e-02 3.574e-02 0.504 0.614557
## TroponinI_max -3.208e-03 7.924e-03 -0.405 0.685588
## Urine_min -6.448e-03 2.640e-03 -2.442 0.014593 *
## WBC_min 6.732e-02 2.790e-02 2.413 0.015819 *
## WBC_max -5.410e-02 2.314e-02 -2.338 0.019385 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1249.2 on 1854 degrees of freedom
## AIC: 1323.2
##
## Number of Fisher Scoring iterations: 6
# Fit a multivariable model using predictor variables that were significant on univariate comparisons
# Note: NISysABP_min was not included as there was a large amount of missing data and was excluded from the dataset
signifUni_glm <- glm(in_hospital_death ~
Age +
ICUType +
Weight_max +
Albumin_min +
Bilirubin_max +
BUN_max +
Creatinine_max +
GCS_max +
Glucose_max +
HCO3_min +
HR_max +
Lactate_max +
Na_min +
pH_min +
RespRate_min +
RespRate_max +
Temp_min +
TroponinT_max +
Urine_min +
WBC_min +
WBC_max
,data=nm_icu_model_df1, family="binomial")
summary(signifUni_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_max + Lactate_max +
## Na_min + pH_min + RespRate_min + RespRate_max + Temp_min +
## TroponinT_max + Urine_min + WBC_min + WBC_max, family = "binomial",
## data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9962 -0.5432 -0.3472 -0.1885 3.0496
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 17.4983480 6.5324846 2.679 0.007392 **
## Age 0.0342487 0.0053335 6.421 1.35e-10 ***
## ICUTypeCardiac Surgery Recovery Unit -1.0944294 0.3077700 -3.556 0.000377 ***
## ICUTypeMedical ICU 0.1730275 0.2267651 0.763 0.445448
## ICUTypeSurgical ICU 0.1607247 0.2477163 0.649 0.516451
## Weight_max -0.0037470 0.0034800 -1.077 0.281611
## Albumin_min -0.3459704 0.1224924 -2.824 0.004737 **
## Bilirubin_max 0.0434501 0.0141021 3.081 0.002062 **
## BUN_max 0.0208413 0.0039279 5.306 1.12e-07 ***
## Creatinine_max -0.0614121 0.0550767 -1.115 0.264838
## GCS_max -0.1809442 0.0249363 -7.256 3.98e-13 ***
## Glucose_max 0.0001212 0.0007685 0.158 0.874679
## HCO3_min 0.0066772 0.0175917 0.380 0.704268
## HR_max 0.0067363 0.0033199 2.029 0.042453 *
## Lactate_max 0.0640215 0.0351525 1.821 0.068569 .
## Na_min -0.0436339 0.0146432 -2.980 0.002884 **
## pH_min -1.1532127 0.8019867 -1.438 0.150450
## RespRate_min -0.0168464 0.0246788 -0.683 0.494841
## RespRate_max 0.0149393 0.0110322 1.354 0.175686
## Temp_min -0.1465388 0.0797714 -1.837 0.066212 .
## TroponinT_max 0.0121568 0.0346822 0.351 0.725948
## Urine_min -0.0062847 0.0025771 -2.439 0.014742 *
## WBC_min 0.0704389 0.0261657 2.692 0.007102 **
## WBC_max -0.0627979 0.0222280 -2.825 0.004725 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1264.0 on 1867 degrees of freedom
## AIC: 1312
##
## Number of Fisher Scoring iterations: 6
# Fit a multivariable model using predictor variables that were significant in the full_glm
signifFull_glm <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
Temp_min +
Urine_min +
WBC_min +
WBC_max
,data=nm_icu_model_df1, family="binomial")
summary(signifFull_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + Temp_min + Urine_min +
## WBC_min + WBC_max, family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9081 -0.5554 -0.3648 -0.2043 3.0189
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 6.041983 2.694720 2.242 0.02495 *
## Age 0.031377 0.004867 6.446 1.15e-10 ***
## ICUTypeCardiac Surgery Recovery Unit -1.222055 0.287243 -4.254 2.10e-05 ***
## ICUTypeMedical ICU 0.080428 0.210997 0.381 0.70307
## ICUTypeSurgical ICU -0.036104 0.229649 -0.157 0.87508
## Albumin_min -0.378020 0.118092 -3.201 0.00137 **
## Bilirubin_max 0.054014 0.013208 4.090 4.32e-05 ***
## BUN_max 0.017323 0.002841 6.098 1.07e-09 ***
## GCS_max -0.184060 0.021093 -8.726 < 2e-16 ***
## Temp_min -0.191837 0.073664 -2.604 0.00921 **
## Urine_min -0.007071 0.002589 -2.731 0.00632 **
## WBC_min 0.057975 0.024692 2.348 0.01888 *
## WBC_max -0.047105 0.020626 -2.284 0.02239 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1295.4 on 1878 degrees of freedom
## AIC: 1321.4
##
## Number of Fisher Scoring iterations: 6
# Compare the reduced models with the full model using analysis of deviance
lapply(list(signifUni_glm, signifFull_glm),
function(x) {print(anova(full_glm, x, test="Chisq"))} )
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + Gender + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min +
## Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max +
## Lactate_max + Length_of_stay + MAP_min + Na_min + Na_max +
## Platelets_min + PFratio + pH_min + pH_max + RespRate_min +
## RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max +
## Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_max +
## HCO3_min + HR_max + Lactate_max + Na_min + pH_min + RespRate_min +
## RespRate_max + Temp_min + TroponinT_max + Urine_min + WBC_min +
## WBC_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1854 1249.2
## 2 1867 1264.0 -13 -14.776 0.3215
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + Gender + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min +
## Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max +
## Lactate_max + Length_of_stay + MAP_min + Na_min + Na_max +
## Platelets_min + PFratio + pH_min + pH_max + RespRate_min +
## RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max +
## Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + Temp_min + Urine_min + WBC_min + WBC_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1854 1249.2
## 2 1878 1295.4 -24 -46.195 0.004195 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [[1]]
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + Gender + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min +
## Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max +
## Lactate_max + Length_of_stay + MAP_min + Na_min + Na_max +
## Platelets_min + PFratio + pH_min + pH_max + RespRate_min +
## RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max +
## Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_max +
## HCO3_min + HR_max + Lactate_max + Na_min + pH_min + RespRate_min +
## RespRate_max + Temp_min + TroponinT_max + Urine_min + WBC_min +
## WBC_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1854 1249.2
## 2 1867 1264.0 -13 -14.776 0.3215
##
## [[2]]
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + Gender + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min +
## Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max +
## Lactate_max + Length_of_stay + MAP_min + Na_min + Na_max +
## Platelets_min + PFratio + pH_min + pH_max + RespRate_min +
## RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max +
## Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + Temp_min + Urine_min + WBC_min + WBC_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1854 1249.2
## 2 1878 1295.4 -24 -46.195 0.004195 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Result: signifUni_glm - support the null hypothesis that the reduced model is a better fit than the full model
## signifFull_glm - reject the null hypothesis (i.e. the reduced model is a worse fit than the full model)
# Compare the AICs of the models
glm.AICs <- c(full_glm$aic, signifUni_glm$aic, signifFull_glm$aic)
names(glm.AICs) <- c('full_glm AIC:', 'signifUni_glm AIC:', 'signifFull_glm AIC:')
glm.AICs
## full_glm AIC: signifUni_glm AIC: signifFull_glm AIC:
## 1323.203 1311.979 1321.398
## Result: signifUni_glm has the lowest AIC
# Further refine the model:
# use the step() function to search the model space with the lowest AIC
reduced_signifUni_glm <- step(signifUni_glm, trace=1)
## Start: AIC=1311.98
## in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_max +
## HCO3_min + HR_max + Lactate_max + Na_min + pH_min + RespRate_min +
## RespRate_max + Temp_min + TroponinT_max + Urine_min + WBC_min +
## WBC_max
##
## Df Deviance AIC
## - Glucose_max 1 1264.0 1310.0
## - TroponinT_max 1 1264.1 1310.1
## - HCO3_min 1 1264.1 1310.1
## - RespRate_min 1 1264.5 1310.5
## - Weight_max 1 1265.2 1311.2
## - Creatinine_max 1 1265.3 1311.3
## - RespRate_max 1 1265.8 1311.8
## <none> 1264.0 1312.0
## - Lactate_max 1 1267.3 1313.3
## - Temp_min 1 1267.4 1313.4
## - pH_min 1 1267.6 1313.6
## - HR_max 1 1268.1 1314.1
## - WBC_min 1 1271.6 1317.6
## - Urine_min 1 1271.8 1317.8
## - Albumin_min 1 1272.0 1318.0
## - WBC_max 1 1272.6 1318.6
## - Na_min 1 1272.7 1318.7
## - Bilirubin_max 1 1273.2 1319.2
## - ICUType 3 1294.4 1336.4
## - BUN_max 1 1292.9 1338.9
## - Age 1 1310.2 1356.2
## - GCS_max 1 1317.8 1363.8
##
## Step: AIC=1310
## in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + HCO3_min +
## HR_max + Lactate_max + Na_min + pH_min + RespRate_min + RespRate_max +
## Temp_min + TroponinT_max + Urine_min + WBC_min + WBC_max
##
## Df Deviance AIC
## - TroponinT_max 1 1264.1 1308.1
## - HCO3_min 1 1264.1 1308.1
## - RespRate_min 1 1264.5 1308.5
## - Weight_max 1 1265.2 1309.2
## - Creatinine_max 1 1265.3 1309.3
## - RespRate_max 1 1265.8 1309.8
## <none> 1264.0 1310.0
## - Temp_min 1 1267.5 1311.5
## - Lactate_max 1 1267.5 1311.5
## - pH_min 1 1267.6 1311.6
## - HR_max 1 1268.1 1312.1
## - WBC_min 1 1271.6 1315.6
## - Urine_min 1 1271.8 1315.8
## - Albumin_min 1 1272.0 1316.0
## - WBC_max 1 1272.6 1316.6
## - Na_min 1 1273.1 1317.1
## - Bilirubin_max 1 1273.2 1317.2
## - ICUType 3 1295.4 1335.4
## - BUN_max 1 1293.2 1337.2
## - Age 1 1310.3 1354.3
## - GCS_max 1 1318.1 1362.1
##
## Step: AIC=1308.13
## in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + HCO3_min +
## HR_max + Lactate_max + Na_min + pH_min + RespRate_min + RespRate_max +
## Temp_min + Urine_min + WBC_min + WBC_max
##
## Df Deviance AIC
## - HCO3_min 1 1264.3 1306.3
## - RespRate_min 1 1264.6 1306.6
## - Weight_max 1 1265.3 1307.3
## - Creatinine_max 1 1265.5 1307.5
## - RespRate_max 1 1266.0 1308.0
## <none> 1264.1 1308.1
## - Temp_min 1 1267.6 1309.6
## - Lactate_max 1 1268.0 1310.0
## - HR_max 1 1268.1 1310.1
## - pH_min 1 1268.2 1310.2
## - Urine_min 1 1272.0 1314.0
## - WBC_min 1 1272.1 1314.1
## - Albumin_min 1 1272.2 1314.2
## - WBC_max 1 1273.0 1315.0
## - Na_min 1 1273.3 1315.3
## - Bilirubin_max 1 1273.8 1315.8
## - ICUType 3 1295.6 1333.6
## - BUN_max 1 1293.3 1335.3
## - Age 1 1310.3 1352.3
## - GCS_max 1 1318.3 1360.3
##
## Step: AIC=1306.27
## in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + HR_max +
## Lactate_max + Na_min + pH_min + RespRate_min + RespRate_max +
## Temp_min + Urine_min + WBC_min + WBC_max
##
## Df Deviance AIC
## - RespRate_min 1 1264.7 1304.7
## - Weight_max 1 1265.4 1305.4
## - Creatinine_max 1 1265.7 1305.7
## - RespRate_max 1 1266.1 1306.1
## <none> 1264.3 1306.3
## - Temp_min 1 1267.7 1307.7
## - Lactate_max 1 1268.0 1308.0
## - pH_min 1 1268.2 1308.2
## - HR_max 1 1268.2 1308.2
## - Urine_min 1 1272.0 1312.0
## - Albumin_min 1 1272.2 1312.2
## - WBC_min 1 1272.4 1312.4
## - Na_min 1 1273.3 1313.3
## - WBC_max 1 1273.6 1313.6
## - Bilirubin_max 1 1274.0 1314.0
## - ICUType 3 1295.6 1331.6
## - BUN_max 1 1293.3 1333.3
## - Age 1 1310.9 1350.9
## - GCS_max 1 1318.3 1358.3
##
## Step: AIC=1304.74
## in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + HR_max +
## Lactate_max + Na_min + pH_min + RespRate_max + Temp_min +
## Urine_min + WBC_min + WBC_max
##
## Df Deviance AIC
## - Weight_max 1 1265.9 1303.9
## - RespRate_max 1 1266.1 1304.1
## - Creatinine_max 1 1266.1 1304.1
## <none> 1264.7 1304.7
## - Temp_min 1 1268.3 1306.3
## - pH_min 1 1268.4 1306.4
## - HR_max 1 1268.5 1306.5
## - Lactate_max 1 1268.6 1306.6
## - Albumin_min 1 1272.5 1310.5
## - Urine_min 1 1272.6 1310.6
## - WBC_min 1 1273.3 1311.3
## - Na_min 1 1273.7 1311.7
## - WBC_max 1 1274.7 1312.7
## - Bilirubin_max 1 1275.1 1313.1
## - ICUType 3 1295.6 1329.6
## - BUN_max 1 1293.9 1331.9
## - Age 1 1310.9 1348.9
## - GCS_max 1 1322.7 1360.7
##
## Step: AIC=1303.91
## in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + Creatinine_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + RespRate_max + Temp_min + Urine_min + WBC_min +
## WBC_max
##
## Df Deviance AIC
## - RespRate_max 1 1267.3 1303.3
## - Creatinine_max 1 1267.5 1303.5
## <none> 1265.9 1303.9
## - pH_min 1 1269.4 1305.4
## - Lactate_max 1 1269.7 1305.7
## - HR_max 1 1269.9 1305.9
## - Temp_min 1 1270.2 1306.2
## - Albumin_min 1 1273.5 1309.5
## - Urine_min 1 1273.8 1309.8
## - WBC_min 1 1274.5 1310.5
## - Na_min 1 1274.7 1310.7
## - WBC_max 1 1276.0 1312.0
## - Bilirubin_max 1 1276.2 1312.2
## - BUN_max 1 1294.3 1330.3
## - ICUType 3 1299.0 1331.0
## - Age 1 1318.6 1354.6
## - GCS_max 1 1323.4 1359.4
##
## Step: AIC=1303.35
## in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + Creatinine_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max
##
## Df Deviance AIC
## - Creatinine_max 1 1268.7 1302.7
## <none> 1267.3 1303.3
## - pH_min 1 1271.0 1305.0
## - Lactate_max 1 1271.1 1305.1
## - Temp_min 1 1271.2 1305.2
## - HR_max 1 1272.4 1306.4
## - Albumin_min 1 1274.5 1308.5
## - Urine_min 1 1275.3 1309.3
## - Na_min 1 1275.5 1309.5
## - WBC_min 1 1275.9 1309.9
## - WBC_max 1 1277.1 1311.1
## - Bilirubin_max 1 1279.9 1313.9
## - BUN_max 1 1295.5 1329.5
## - ICUType 3 1299.8 1329.8
## - Age 1 1319.1 1353.1
## - GCS_max 1 1336.5 1370.5
##
## Step: AIC=1302.69
## in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
##
## Df Deviance AIC
## <none> 1268.7 1302.7
## - pH_min 1 1272.3 1304.3
## - Lactate_max 1 1272.4 1304.4
## - Temp_min 1 1272.6 1304.6
## - HR_max 1 1274.0 1306.0
## - Urine_min 1 1276.0 1308.0
## - Na_min 1 1276.1 1308.1
## - Albumin_min 1 1276.2 1308.2
## - WBC_min 1 1277.5 1309.5
## - WBC_max 1 1278.7 1310.7
## - Bilirubin_max 1 1281.0 1313.0
## - ICUType 3 1301.4 1329.4
## - BUN_max 1 1304.3 1336.3
## - Age 1 1325.3 1357.3
## - GCS_max 1 1337.8 1369.8
# removed variables were:
# Glucose_max
# TroponinT_max
# HCO3_min
# RespRate_min
# Weight_max
# RespRate_max
# Creatinine_max
summary(reduced_signifUni_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max,
## family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9486 -0.5477 -0.3487 -0.1934 2.9740
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 16.356008 6.151310 2.659 0.007839 **
## Age 0.036076 0.005101 7.073 1.52e-12 ***
## ICUTypeCardiac Surgery Recovery Unit -1.124869 0.292523 -3.845 0.000120 ***
## ICUTypeMedical ICU 0.154914 0.215981 0.717 0.473214
## ICUTypeSurgical ICU 0.119467 0.236040 0.506 0.612765
## Albumin_min -0.328175 0.119889 -2.737 0.006194 **
## Bilirubin_max 0.047859 0.013420 3.566 0.000362 ***
## BUN_max 0.017377 0.002901 5.990 2.10e-09 ***
## GCS_max -0.181546 0.021780 -8.335 < 2e-16 ***
## HR_max 0.007428 0.003223 2.305 0.021190 *
## Lactate_max 0.064245 0.033186 1.936 0.052876 .
## Na_min -0.038924 0.014096 -2.761 0.005756 **
## pH_min -1.080140 0.753194 -1.434 0.151549
## Temp_min -0.152247 0.078232 -1.946 0.051642 .
## Urine_min -0.005960 0.002510 -2.375 0.017571 *
## WBC_min 0.074555 0.025690 2.902 0.003707 **
## WBC_max -0.065889 0.021707 -3.035 0.002402 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1268.7 on 1874 degrees of freedom
## AIC: 1302.7
##
## Number of Fisher Scoring iterations: 6
# Compare the deviance of the further reduced model to signifUni_glm
anova(reduced_signifUni_glm, signifUni_glm, test="Chisq")
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_max +
## HCO3_min + HR_max + Lactate_max + Na_min + pH_min + RespRate_min +
## RespRate_max + Temp_min + TroponinT_max + Urine_min + WBC_min +
## WBC_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1867 1264.0 7 4.7073 0.6956
## Result: p value is not significant, the dropped parameters do not improve the fit of the model
Full model - a logistic model with all selected variables (excluding those with high degree of missingness) has been fitted. In the resulting fitted model, Age, ICUType, Albumin_min, Bilirubin_max, BUN_max, GCS_max, Temp_min, Urine_min, WBC_min and WBC_max are significant. These results do align with our brief EDA. The AIC of the model is 1323.
Significant on univariate model - for parsimony, we look for a reduced model with fewer variables than can adequately explain the occurrence of in-hospital death for the ICU patient population. Our first attempt is to only include variables were significant in univariate logistic regression. Since the reduced model is nested in the full model, we use analysis of deviance to compare the two models. We accept the null hypothesis (p = 0.32) and conclude that the reduced model is a better fit to the data. This conclusion aligns with the models’ respective AICs - the signifUni_glm model has a lower AIC of 1312.
Significant on full model - the second attempt, reduces the full model again, this time by only including variables that were significant in the original full model itself. We again use the analysis of deviance to compare this model with the full model as the models are nested. We reject the null hypothesis (p = 0.004) and conclude that the full model is a better fit to the data. The AIC of this model (1321) is very similar to the full model (1323), however we do not continue to improve on the model as the significant analysis of deviance suggests we have excluded one or more important predictors.
Reduced significant on univariate variable model - a further attempt to simplify this predictive model starts with the signifUni_glm model (number 2 in this list) and uses the step function to search the model space for a model with a better fit and fewer covariates. After 6 iterations, the reduced model includes 14 covariates. The variables: Glucose_max, TroponinT_max, HCO3_min, RespRate_min, Weight_max, RespRate_max and Creatinine_max were removed. When compared with the signifUni_glm model using analysis of deviance, the null hypothesis (p = 0.7) is accepted and we conclude that this reduced model is a better fit to the data than the signifUni_glm model. Furthermore, there is greater parsimony and the AIC is further reduced to 1302.
# Choosing a final model
# Initially, start with a provisional final model
# which is the same as the best-performing model above: reduced_signifUni_glm
finalICU_glm <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max
,data=nm_icu_model_df1, family="binomial")
summary(finalICU_glm)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max,
## family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9486 -0.5477 -0.3487 -0.1934 2.9740
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 16.356008 6.151310 2.659 0.007839 **
## Age 0.036076 0.005101 7.073 1.52e-12 ***
## ICUTypeCardiac Surgery Recovery Unit -1.124869 0.292523 -3.845 0.000120 ***
## ICUTypeMedical ICU 0.154914 0.215981 0.717 0.473214
## ICUTypeSurgical ICU 0.119467 0.236040 0.506 0.612765
## Albumin_min -0.328175 0.119889 -2.737 0.006194 **
## Bilirubin_max 0.047859 0.013420 3.566 0.000362 ***
## BUN_max 0.017377 0.002901 5.990 2.10e-09 ***
## GCS_max -0.181546 0.021780 -8.335 < 2e-16 ***
## HR_max 0.007428 0.003223 2.305 0.021190 *
## Lactate_max 0.064245 0.033186 1.936 0.052876 .
## Na_min -0.038924 0.014096 -2.761 0.005756 **
## pH_min -1.080140 0.753194 -1.434 0.151549
## Temp_min -0.152247 0.078232 -1.946 0.051642 .
## Urine_min -0.005960 0.002510 -2.375 0.017571 *
## WBC_min 0.074555 0.025690 2.902 0.003707 **
## WBC_max -0.065889 0.021707 -3.035 0.002402 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1268.7 on 1874 degrees of freedom
## AIC: 1302.7
##
## Number of Fisher Scoring iterations: 6
## Test some interactions based on clinical knowledge ##
# finalICU_glm_AgeCr = finalICU_glm + Age:Creatinine_max
finalICU_glm_AgeCr <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max +
# interaction term
Age:Creatinine_max # creatinine generally increases with age
, data=nm_icu_model_df1, family="binomial")
summary(finalICU_glm_AgeCr)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max +
## Age:Creatinine_max, family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.0140 -0.5482 -0.3476 -0.1901 2.9975
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 16.7954577 6.2374340 2.693 0.007088 **
## Age 0.0368478 0.0051411 7.167 7.65e-13 ***
## ICUTypeCardiac Surgery Recovery Unit -1.1224281 0.2929720 -3.831 0.000128 ***
## ICUTypeMedical ICU 0.1606782 0.2163593 0.743 0.457696
## ICUTypeSurgical ICU 0.1234378 0.2364108 0.522 0.601578
## Albumin_min -0.3173436 0.1202847 -2.638 0.008333 **
## Bilirubin_max 0.0479804 0.0134156 3.576 0.000348 ***
## BUN_max 0.0206145 0.0038919 5.297 1.18e-07 ***
## GCS_max -0.1817466 0.0218044 -8.335 < 2e-16 ***
## HR_max 0.0072332 0.0032265 2.242 0.024975 *
## Lactate_max 0.0651878 0.0332601 1.960 0.050003 .
## Na_min -0.0406980 0.0141306 -2.880 0.003975 **
## pH_min -1.1107505 0.7677759 -1.447 0.147978
## Temp_min -0.1523686 0.0783258 -1.945 0.051737 .
## Urine_min -0.0063524 0.0025870 -2.455 0.014070 *
## WBC_min 0.0732008 0.0256788 2.851 0.004363 **
## WBC_max -0.0651354 0.0216691 -3.006 0.002648 **
## Age:Creatinine_max -0.0010905 0.0008797 -1.240 0.215106
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1267.1 on 1873 degrees of freedom
## AIC: 1303.1
##
## Number of Fisher Scoring iterations: 6
# finalICU_glm_AgeTemp = finalICU_glm + Age:Temp_min
finalICU_glm_AgeTemp <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max +
# interaction term
Age:Temp_min # low temp more often associated with illness in the elderly e.g. cold sepsis
, data=nm_icu_model_df1, family="binomial")
summary(finalICU_glm_AgeTemp)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max +
## Age:Temp_min, family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9484 -0.5479 -0.3491 -0.1934 2.9750
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 16.7044490 11.1514886 1.498 0.134144
## Age 0.0309382 0.1372347 0.225 0.821637
## ICUTypeCardiac Surgery Recovery Unit -1.1244884 0.2926769 -3.842 0.000122 ***
## ICUTypeMedical ICU 0.1549708 0.2159709 0.718 0.473032
## ICUTypeSurgical ICU 0.1194984 0.2360247 0.506 0.612649
## Albumin_min -0.3282807 0.1199208 -2.737 0.006191 **
## Bilirubin_max 0.0478505 0.0134229 3.565 0.000364 ***
## BUN_max 0.0173795 0.0029016 5.990 2.1e-09 ***
## GCS_max -0.1814953 0.0218225 -8.317 < 2e-16 ***
## HR_max 0.0074244 0.0032240 2.303 0.021285 *
## Lactate_max 0.0641848 0.0332272 1.932 0.053397 .
## Na_min -0.0389322 0.0140974 -2.762 0.005751 **
## pH_min -1.0801902 0.7531476 -1.434 0.151505
## Temp_min -0.1619252 0.2699562 -0.600 0.548626
## Urine_min -0.0059595 0.0025100 -2.374 0.017582 *
## WBC_min 0.0745197 0.0257058 2.899 0.003744 **
## WBC_max -0.0658591 0.0217208 -3.032 0.002429 **
## Age:Temp_min 0.0001434 0.0038270 0.037 0.970115
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1268.7 on 1873 degrees of freedom
## AIC: 1304.7
##
## Number of Fisher Scoring iterations: 6
# finalICU_glm_AgeWeight = finalICU_glm + Age:Weight_max
finalICU_glm_AgeWeight <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max +
# interaction term
Age:Weight_max # weight generally decreases with age
, data=nm_icu_model_df1, family="binomial")
summary(finalICU_glm_AgeWeight)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max +
## Age:Weight_max, family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.0134 -0.5477 -0.3476 -0.1903 3.0731
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 1.668e+01 6.306e+00 2.646 0.008153 **
## Age 4.009e-02 5.765e-03 6.954 3.54e-12 ***
## ICUTypeCardiac Surgery Recovery Unit -1.083e+00 2.938e-01 -3.687 0.000227 ***
## ICUTypeMedical ICU 1.463e-01 2.163e-01 0.676 0.498765
## ICUTypeSurgical ICU 1.295e-01 2.364e-01 0.548 0.583897
## Albumin_min -3.345e-01 1.200e-01 -2.787 0.005315 **
## Bilirubin_max 4.817e-02 1.345e-02 3.582 0.000341 ***
## BUN_max 1.800e-02 2.933e-03 6.138 8.37e-10 ***
## GCS_max -1.828e-01 2.183e-02 -8.375 < 2e-16 ***
## HR_max 7.074e-03 3.239e-03 2.184 0.028979 *
## Lactate_max 6.631e-02 3.333e-02 1.990 0.046641 *
## Na_min -3.928e-02 1.407e-02 -2.791 0.005253 **
## pH_min -1.185e+00 7.863e-01 -1.506 0.131975
## Temp_min -1.343e-01 7.886e-02 -1.703 0.088579 .
## Urine_min -5.888e-03 2.507e-03 -2.349 0.018820 *
## WBC_min 7.430e-02 2.570e-02 2.891 0.003844 **
## WBC_max -6.506e-02 2.174e-02 -2.993 0.002765 **
## Age:Weight_max -7.479e-05 5.068e-05 -1.476 0.139998
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1266.4 on 1873 degrees of freedom
## AIC: 1302.4
##
## Number of Fisher Scoring iterations: 6
# finalICU_glm_AgeAlbumin = finalICU_glm + Age:Albumin_min
finalICU_glm_AgeAlbumin <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max +
# interaction term
Age:Albumin_min # albumin generally decreases with age
, data=nm_icu_model_df1, family="binomial")
summary(finalICU_glm_AgeAlbumin)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max +
## Age:Albumin_min, family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9408 -0.5541 -0.3473 -0.1840 3.0048
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 18.885563 6.143325 3.074 0.002111 **
## Age -0.003874 0.021602 -0.179 0.857688
## ICUTypeCardiac Surgery Recovery Unit -1.119083 0.292623 -3.824 0.000131 ***
## ICUTypeMedical ICU 0.143368 0.216393 0.663 0.507629
## ICUTypeSurgical ICU 0.120432 0.236158 0.510 0.610077
## Albumin_min -1.334946 0.549855 -2.428 0.015190 *
## Bilirubin_max 0.048556 0.013473 3.604 0.000313 ***
## BUN_max 0.017484 0.002905 6.019 1.75e-09 ***
## GCS_max -0.180892 0.021823 -8.289 < 2e-16 ***
## HR_max 0.007224 0.003227 2.238 0.025190 *
## Lactate_max 0.063918 0.033324 1.918 0.055102 .
## Na_min -0.038243 0.014202 -2.693 0.007087 **
## pH_min -1.049726 0.722916 -1.452 0.146482
## Temp_min -0.153804 0.078509 -1.959 0.050105 .
## Urine_min -0.005841 0.002510 -2.327 0.019966 *
## WBC_min 0.075874 0.025690 2.953 0.003143 **
## WBC_max -0.065719 0.021677 -3.032 0.002431 **
## Age:Albumin_min 0.014318 0.007608 1.882 0.059848 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1265.1 on 1873 degrees of freedom
## AIC: 1301.1
##
## Number of Fisher Scoring iterations: 6
# finalICU_glm_AgeICUType = finalICU_glm + Age:ICUType
finalICU_glm_AgeICUType <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max +
# interaction term
Age:ICUType # age is likely to be related to ICU type
# e.g. elderly more likely to have poor outcome
# after surgery requiring post-op ICU support
, data=nm_icu_model_df1, family="binomial")
summary(finalICU_glm_AgeICUType)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max +
## Age:ICUType, family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9629 -0.5527 -0.3441 -0.1925 3.1007
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 17.387358 6.291001 2.764 0.005712
## Age 0.029481 0.015313 1.925 0.054210
## ICUTypeCardiac Surgery Recovery Unit -0.068485 1.723350 -0.040 0.968301
## ICUTypeMedical ICU 0.241325 1.244356 0.194 0.846227
## ICUTypeSurgical ICU -2.083615 1.367233 -1.524 0.127517
## Albumin_min -0.326734 0.121044 -2.699 0.006949
## Bilirubin_max 0.047832 0.013546 3.531 0.000414
## BUN_max 0.017791 0.002906 6.123 9.17e-10
## GCS_max -0.183364 0.021874 -8.383 < 2e-16
## HR_max 0.007922 0.003237 2.447 0.014388
## Lactate_max 0.063755 0.033330 1.913 0.055766
## Na_min -0.039777 0.014120 -2.817 0.004848
## pH_min -1.101606 0.765613 -1.439 0.150192
## Temp_min -0.160314 0.079365 -2.020 0.043388
## Urine_min -0.006072 0.002519 -2.410 0.015933
## WBC_min 0.074950 0.025906 2.893 0.003814
## WBC_max -0.067784 0.021921 -3.092 0.001987
## Age:ICUTypeCardiac Surgery Recovery Unit -0.014947 0.023505 -0.636 0.524823
## Age:ICUTypeMedical ICU -0.001857 0.016593 -0.112 0.910887
## Age:ICUTypeSurgical ICU 0.030947 0.018227 1.698 0.089540
##
## (Intercept) **
## Age .
## ICUTypeCardiac Surgery Recovery Unit
## ICUTypeMedical ICU
## ICUTypeSurgical ICU
## Albumin_min **
## Bilirubin_max ***
## BUN_max ***
## GCS_max ***
## HR_max *
## Lactate_max .
## Na_min **
## pH_min
## Temp_min *
## Urine_min *
## WBC_min **
## WBC_max **
## Age:ICUTypeCardiac Surgery Recovery Unit
## Age:ICUTypeMedical ICU
## Age:ICUTypeSurgical ICU .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1258.8 on 1871 degrees of freedom
## AIC: 1298.8
##
## Number of Fisher Scoring iterations: 6
# Analysis of deviance tests for the new models
lapply(list(finalICU_glm_AgeCr, finalICU_glm_AgeTemp, finalICU_glm_AgeWeight,
finalICU_glm_AgeAlbumin, finalICU_glm_AgeICUType),
function(x) {print(anova(finalICU_glm, x, test="Chisq"))} )
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Creatinine_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1267.1 1 1.6139 0.204
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Temp_min
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1268.7 1 0.0014025 0.9701
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Weight_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1266.4 1 2.2478 0.1338
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Albumin_min
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1265.1 1 3.5451 0.05972 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:ICUType
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1871 1258.8 3 9.8927 0.0195 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [[1]]
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Creatinine_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1267.1 1 1.6139 0.204
##
## [[2]]
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Temp_min
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1268.7 1 0.0014025 0.9701
##
## [[3]]
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Weight_max
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1266.4 1 2.2478 0.1338
##
## [[4]]
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:Albumin_min
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1873 1265.1 1 3.5451 0.05972 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## [[5]]
## Analysis of Deviance Table
##
## Model 1: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max
## Model 2: in_hospital_death ~ Age + ICUType + Albumin_min + Bilirubin_max +
## BUN_max + GCS_max + HR_max + Lactate_max + Na_min + pH_min +
## Temp_min + Urine_min + WBC_min + WBC_max + Age:ICUType
## Resid. Df Resid. Dev Df Deviance Pr(>Chi)
## 1 1874 1268.7
## 2 1871 1258.8 3 9.8927 0.0195 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Result: borderline effect for age:albumin (p=0.054)
## significant effect for age:icutype (p=0.016)
# Input the significant interactions into the model
finalICU_glm_interactions <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max +
# significant interaction terms
Age:ICUType + Age:Albumin_min
, data=nm_icu_model_df1, family="binomial")
summary(finalICU_glm_interactions)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max +
## Age:ICUType + Age:Albumin_min, family = "binomial", data = nm_icu_model_df1)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.9544 -0.5554 -0.3368 -0.1858 3.2325
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 20.337429 6.338654 3.208 0.001334
## Age -0.016517 0.028793 -0.574 0.566203
## ICUTypeCardiac Surgery Recovery Unit -0.488610 1.735862 -0.281 0.778342
## ICUTypeMedical ICU -0.197867 1.267120 -0.156 0.875911
## ICUTypeSurgical ICU -2.436070 1.376251 -1.770 0.076714
## Albumin_min -1.364216 0.567808 -2.403 0.016279
## Bilirubin_max 0.048654 0.013589 3.580 0.000343
## BUN_max 0.017941 0.002910 6.164 7.07e-10
## GCS_max -0.182193 0.021886 -8.324 < 2e-16
## HR_max 0.007705 0.003240 2.378 0.017403
## Lactate_max 0.063945 0.033431 1.913 0.055779
## Na_min -0.039164 0.014231 -2.752 0.005923
## pH_min -1.065290 0.734016 -1.451 0.146692
## Temp_min -0.161893 0.079458 -2.037 0.041603
## Urine_min -0.005945 0.002513 -2.366 0.017995
## WBC_min 0.075932 0.025880 2.934 0.003346
## WBC_max -0.067477 0.021869 -3.086 0.002032
## Age:ICUTypeCardiac Surgery Recovery Unit -0.009249 0.023635 -0.391 0.695555
## Age:ICUTypeMedical ICU 0.003869 0.016868 0.229 0.818596
## Age:ICUTypeSurgical ICU 0.035562 0.018322 1.941 0.052261
## Age:Albumin_min 0.014713 0.007840 1.876 0.060587
##
## (Intercept) **
## Age
## ICUTypeCardiac Surgery Recovery Unit
## ICUTypeMedical ICU
## ICUTypeSurgical ICU .
## Albumin_min *
## Bilirubin_max ***
## BUN_max ***
## GCS_max ***
## HR_max *
## Lactate_max .
## Na_min **
## pH_min
## Temp_min *
## Urine_min *
## WBC_min **
## WBC_max **
## Age:ICUTypeCardiac Surgery Recovery Unit
## Age:ICUTypeMedical ICU
## Age:ICUTypeSurgical ICU .
## Age:Albumin_min .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 1596.4 on 1890 degrees of freedom
## Residual deviance: 1255.3 on 1870 degrees of freedom
## AIC: 1297.3
##
## Number of Fisher Scoring iterations: 6
# Examine the ORs and profiled 95% CIs
exp(coef(finalICU_glm_interactions))
## (Intercept)
## 6.798816e+08
## Age
## 9.836186e-01
## ICUTypeCardiac Surgery Recovery Unit
## 6.134784e-01
## ICUTypeMedical ICU
## 8.204791e-01
## ICUTypeSurgical ICU
## 8.750404e-02
## Albumin_min
## 2.555810e-01
## Bilirubin_max
## 1.049857e+00
## BUN_max
## 1.018103e+00
## GCS_max
## 8.334405e-01
## HR_max
## 1.007735e+00
## Lactate_max
## 1.066034e+00
## Na_min
## 9.615935e-01
## pH_min
## 3.446278e-01
## Temp_min
## 8.505320e-01
## Urine_min
## 9.940730e-01
## WBC_min
## 1.078889e+00
## WBC_max
## 9.347489e-01
## Age:ICUTypeCardiac Surgery Recovery Unit
## 9.907935e-01
## Age:ICUTypeMedical ICU
## 1.003876e+00
## Age:ICUTypeSurgical ICU
## 1.036202e+00
## Age:Albumin_min
## 1.014821e+00
exp(confint(finalICU_glm_interactions))
## Waiting for profiling to be done...
## 2.5 % 97.5 %
## (Intercept) 9.214696e+03 3.462644e+14
## Age 9.301492e-01 1.041231e+00
## ICUTypeCardiac Surgery Recovery Unit 1.932952e-02 1.822651e+01
## ICUTypeMedical ICU 7.538148e-02 1.101548e+01
## ICUTypeSurgical ICU 6.234663e-03 1.407755e+00
## Albumin_min 8.346033e-02 7.728303e-01
## Bilirubin_max 1.022090e+00 1.078329e+00
## BUN_max 1.012335e+00 1.023972e+00
## GCS_max 7.982643e-01 8.698539e-01
## HR_max 1.001343e+00 1.014171e+00
## Lactate_max 9.981865e-01 1.138016e+00
## Na_min 9.352243e-01 9.890105e-01
## pH_min 7.020585e-02 1.009620e+00
## Temp_min 7.270077e-01 9.924219e-01
## Urine_min 9.887813e-01 9.985387e-01
## WBC_min 1.026486e+00 1.136334e+00
## WBC_max 8.943377e-01 9.745706e-01
## Age:ICUTypeCardiac Surgery Recovery Unit 9.460191e-01 1.038276e+00
## Age:ICUTypeMedical ICU 9.701374e-01 1.036636e+00
## Age:ICUTypeSurgical ICU 9.988963e-01 1.073532e+00
## Age:Albumin_min 9.993855e-01 1.030575e+00
In order to further improve the model, we choose to test some interaction terms based on clinical/conceptual interactions between predictors. The tested interactions were Age with each of: Creatinine_max, Temp_min, Weight_max, Albumin_min and ICUType. Each interaction term was added one at a time and compared to the provisional ‘final’ model with analysis of deviance. The analysis of deviance revealed a significant interaction effect on the model of Age:ICUType (p = 0.016) and Age:Albumin_min (p = 0.054). Both terms were added to the provisional final model and the resulting model had a lower AIC again of 1297 (compared to 1302).
## Using the 'final' model = finalICU_glm_interactions: ##
### Goodness of fit using bins df1 ###
# add predicted probabilities to the data frame
nm_icu_model_df1 %>% mutate(predprob=predict(finalICU_glm_interactions, type="response"),
linpred=predict(finalICU_glm_interactions)) %>%
# group the data into bins based on the linear predictor fitted values
group_by(cut(linpred, breaks=unique(quantile(linpred, (1:50)/51)))) %>%
# summarise by bin
summarise(death_bin=sum(in_hospital_death), predprob_bin=mean(predprob), n_bin=n()) %>%
# add the standard error of the mean predicted probaility for each bin
mutate(se_predprob_bin=sqrt(predprob_bin*(1 - predprob_bin)/n_bin)) %>%
# plot it with 95% confidence interval bars
ggplot(aes(x=predprob_bin,
y=death_bin/n_bin,
ymin=death_bin/n_bin - 1.96*se_predprob_bin,
ymax=death_bin/n_bin + 1.96*se_predprob_bin)) +
geom_point() + geom_linerange(colour="orange", alpha=0.4) +
geom_abline(intercept=0, slope=1) +
labs(x="Predicted probability (binned)",
y="Observed proportion (in each bin)")
# the ideal calibration line fits within most of the dots and their 95% CI
### Goodness of fit using Hosmer Lemeshow stat ###
nm_icu_model_df1 %>% mutate(predprob=predict(finalICU_glm_interactions, type="response"),
linpred=predict(finalICU_glm_interactions)) %>%
group_by(cut(linpred, breaks=unique(quantile(linpred, (1:50)/51)))) %>%
summarise(death_bin=sum(in_hospital_death), predprob_bin=mean(predprob), n_bin=n()) %>%
mutate(se_predprob_bin=sqrt(predprob_bin*(1 - predprob_bin)/n_bin)) -> hl_df
hl_stat <- with(hl_df, sum( (death_bin - n_bin*predprob_bin)^2 /
(n_bin* predprob_bin*(1 - predprob_bin))))
hl <- c(hosmer_lemeshow_stat=hl_stat, hl_degrees_freedom=nrow(hl_df) - 1)
hl
## hosmer_lemeshow_stat hl_degrees_freedom
## 44.40147 49.00000
# calculate p-value
c(p_val=1 - pchisq(hl[1], hl[2])) # the p value here is not statistically significant, indicating no lack of fit
## p_val.hosmer_lemeshow_stat
## 0.6598141
### Brier score ###
get_brier <- function(model){
predprob <- predict(model, type="response")
Brier_score <- mean((predprob - nm_icu_model_df1$in_hospital_death)^2)
return(Brier_score)
}
get_brier(finalICU_glm)
## [1] 0.1029798
get_brier(finalICU_glm_interactions)
## [1] 0.1020453
# the final model with interactions has slightly lower brier score -> lower score is better fit
### ROC Curve ###
# add the predicted probailities to the data frame
nm_icu_model_df1 %>% mutate(predprob=predict(finalICU_glm_interactions, type="response")) -> nm_icu_model_df1
# create multiple probability thresholds from 0.01 to 0.95
thresholds <- seq(0.01, 0.95, by=0.01)
# initialise sensitivities/specificities at the same length as thresholds vector
sensitivities <- numeric(length(thresholds))
specificities <- numeric(length(thresholds))
# for each probability threshold, run this loop
for (i in seq_along(thresholds)) {
# assign yes or no - if predicted probability greater to threshold
pp <- ifelse(nm_icu_model_df1$predprob < thresholds[i], "no", "yes")
# create confusion matrix with respective in_hospital_death and pp values
xx <- xtabs( ~ in_hospital_death + pp, data=nm_icu_model_df1)
# calculate sens and spec for each threshold using confusion matrix values
specificities[i] <- xx[1,1] / (xx[1,1] + xx[1,2])
sensitivities[i] <- xx[2,2] / (xx[2,1] + xx[2,2])
}
# plot the ROC
plot(1 - specificities, sensitivities, type="l",
xlab="1 - Specificity", ylab="Sensitivity", main='ROC curve of the final model',
xlim=c(0,1), ylim=c(0,1))
abline(0,1, lty=2)
# calculate AUC
# sorts sensitivity and specificities into x and y coordinates
x <- sort(1-specificities)
y <- sort(sensitivities)
# use AUC function from {DescTools} package to calculate AUC
paste('The AUC is:', AUC(x,y))
## [1] "The AUC is: 0.757757150642547"
Our multivariable logistic regression model for mortality of the imputed ICU dataset (icu_patients_df1) is based on initial variables selected due to known association with mortality either individually or as part of a validated ICU risk score (SOFA, SAPS1 and APACHE). Based on initial EDA, variables with a large proportion of missing data were excluded from the analysis (Height, NISysABP_min, NISysABP_max).
After analysing a series of fitted multivariable logistic regression models and exploring the effect of interaction terms, as explained above, we arrive at the final chosen model to predict in-hospital death in patients who have been admitted to ICU: finalICU_glm_interactions.
Goodness of fit of the chosen final model was explored using several methods. Firstly, we plot predicted probabilities in bins against the observed proportions in each bin to examine calibration. The plot shows sound calibration, with similar observed proportions and predicted probabilities, without any systematic deviation from the ideal calibration line. Further, almost all 95% CIs (except one) of each bin overlap the ideal calibration line, which suggests the model is realtively well-calibrated. The non-significant Hosmer-Lemeshow test (p=0.66) further supports no ‘lack of fit’ of the model, although this test is not without limitations and the choice of bins is arbitrary. The Brier score test (which does not rely on arbitrary bins) does further support the choice of the final model with interaction terms included (finalICU_glm_interactions) over the model without interaction terms (finalICU_glm), with the former having a marginally lower Brier score (0.102 vs 0.103) indicating greater predictive ability. Lastly, the predictive value of this model (finalICU_glm_interactions) was assessed by producing a ROC (receiver operating characteristic) curve. The ROC curve suggests moderate predictive ability of the model, with an AUC of 0.75 - indicating approximately a 75% chance of the model correctly predicting whether a patient will experience in_hospital_death after an ICU admission of >48 hours.
The pertinent characteristics of our predictive model suggests that in the first 24 hours of an ICU admission, higher Albumin_min (OR: 0.26, 95% CI: 0.08-0.77, p = 0.02), GCS_max (OR: 0.83, 95% CI: 0.80-0.87, p < 0.001), Na_min (OR: 0.96, 95% CI: 0.94-0.99, p = 0.006), Temp_min (OR: 0.85, 95% CI: 0.73-0.99, p = 0.04), Urine_min (OR: 0.99, 95% CI: 0.99-1.00 p = 0.02) and WBC_max (OR: 0.93, 95% CI: 0.89-0.97, p = 0.002) values reduce the odds of in-hospital death after an ICU admission of >48 hours; while higher Bilirubin_max (OR: 1.05, 95% CI: 1.02-1.08, p < 0.001), BUN_max (OR: 1.02, 95% CI: 1.01-1.02, p < 0.001), HR_max (OR: 1.01, 95% CI: 1.00-1.01, p = 0.02) and WBC_min (OR: 1.08, 95% CI: 1.03-1.14, p = 0.003) values increase the odds of in-hospital death after an ICU admission of >48 hours.
Based on the OR and profiled 95% CIs of these predictors of in-hospital death, in the first 24 hours of ICU admission, having a higher minimum albumin level and higher maximum GCS score reduce the odds of in-hospital death with relative certainty, while having a higher minimum white blood cell count increases the odds of in-hospital death in the ICU population.
Although these individual ORs provide some insights into the relative importance of different parameters, adequate overall prediction of in-hospital death after an ICU admission of >48 hours requires all of the predictor variables in the final model. Interestingly, age is not an individual predictor of in-hospital death using our model, although it remains important to include for the model’s overall predictive capability.
As the goal of our model was predictive, there may be other important parameters that are required to better understand and explain in-hospital death after ICU admission, however our aim was to produce the simplest possible model to adequately predict the outcome of interest, hence some of these explanatory values may not be included.
Finally, it is important to note that as the outcome in_hospital_death was not uncommon in this dataset (297 deaths out of 2061 observations = 14.4%), the logistic regression output must be interpreted with caution. The listed ORs (odds ratios) must not be interpreted as RRs (risk ratios), as with a relatively common outcome (>10% observations), odds no longer estimates risk (it over-estimates risk). In further analysis, it may be useful to trial other types of regression to calculate RRs rather than ORs, such as log-binomial (although may encounter non-convergence with many predictors) or modified poisson regression.
#### re-fit the final model to the unimputed data frame
# (`icu_patients_df0.rds`) and comment on any differences you find
# compared to the same model fitted to the data without imputation,
df0_finalICU_glm_interactions <- glm(in_hospital_death ~
Age +
ICUType +
Albumin_min +
Bilirubin_max +
BUN_max +
GCS_max +
HR_max +
Lactate_max +
Na_min +
pH_min +
Temp_min +
Urine_min +
WBC_min +
WBC_max +
Age:ICUType + Age:Albumin_min
, data=icu_patients_df0, family="binomial")
summary(df0_finalICU_glm_interactions)
##
## Call:
## glm(formula = in_hospital_death ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HR_max + Lactate_max +
## Na_min + pH_min + Temp_min + Urine_min + WBC_min + WBC_max +
## Age:ICUType + Age:Albumin_min, family = "binomial", data = icu_patients_df0)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -2.0796 -0.5851 -0.3221 -0.1132 3.0310
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 27.261971 15.618682 1.745 0.080903
## Age 0.084514 0.074238 1.138 0.254949
## ICUTypeCardiac Surgery Recovery Unit 0.730898 5.521035 0.132 0.894680
## ICUTypeMedical ICU -0.147974 3.093787 -0.048 0.961852
## ICUTypeSurgical ICU 0.681712 3.226486 0.211 0.832664
## Albumin_min -0.111573 1.334217 -0.084 0.933355
## Bilirubin_max 0.045677 0.031016 1.473 0.140834
## BUN_max 0.022170 0.006091 3.640 0.000273
## GCS_max -0.149812 0.050123 -2.989 0.002800
## HR_max 0.014980 0.008350 1.794 0.072819
## Lactate_max 0.050180 0.068215 0.736 0.461960
## Na_min -0.065969 0.039336 -1.677 0.093532
## pH_min -1.749588 1.905015 -0.918 0.358403
## Temp_min -0.279081 0.158228 -1.764 0.077767
## Urine_min -0.002243 0.005209 -0.431 0.666708
## WBC_min 0.108851 0.053332 2.041 0.041250
## WBC_max -0.107694 0.042883 -2.511 0.012027
## Age:ICUTypeCardiac Surgery Recovery Unit -0.054997 0.083252 -0.661 0.508866
## Age:ICUTypeMedical ICU -0.002158 0.044497 -0.049 0.961315
## Age:ICUTypeSurgical ICU -0.022395 0.046757 -0.479 0.631968
## Age:Albumin_min -0.012685 0.019718 -0.643 0.520011
##
## (Intercept) .
## Age
## ICUTypeCardiac Surgery Recovery Unit
## ICUTypeMedical ICU
## ICUTypeSurgical ICU
## Albumin_min
## Bilirubin_max
## BUN_max ***
## GCS_max **
## HR_max .
## Lactate_max
## Na_min .
## pH_min
## Temp_min .
## Urine_min
## WBC_min *
## WBC_max *
## Age:ICUTypeCardiac Surgery Recovery Unit
## Age:ICUTypeMedical ICU
## Age:ICUTypeSurgical ICU
## Age:Albumin_min
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 307.90 on 298 degrees of freedom
## Residual deviance: 215.99 on 278 degrees of freedom
## (1762 observations deleted due to missingness)
## AIC: 257.99
##
## Number of Fisher Scoring iterations: 6
# when using the predictors from our final df1 model with interactions onto df0 data
# 1762 observations are removed due to missingness
# Examine ORs and profiled 95% CIs
exp(coef(df0_finalICU_glm_interactions))
## (Intercept)
## 6.913907e+11
## Age
## 1.088188e+00
## ICUTypeCardiac Surgery Recovery Unit
## 2.076946e+00
## ICUTypeMedical ICU
## 8.624536e-01
## ICUTypeSurgical ICU
## 1.977259e+00
## Albumin_min
## 8.944263e-01
## Bilirubin_max
## 1.046736e+00
## BUN_max
## 1.022417e+00
## GCS_max
## 8.608698e-01
## HR_max
## 1.015093e+00
## Lactate_max
## 1.051461e+00
## Na_min
## 9.361601e-01
## pH_min
## 1.738456e-01
## Temp_min
## 7.564786e-01
## Urine_min
## 9.977590e-01
## WBC_min
## 1.114997e+00
## WBC_max
## 8.979022e-01
## Age:ICUTypeCardiac Surgery Recovery Unit
## 9.464883e-01
## Age:ICUTypeMedical ICU
## 9.978441e-01
## Age:ICUTypeSurgical ICU
## 9.778541e-01
## Age:Albumin_min
## 9.873947e-01
exp(confint(df0_finalICU_glm_interactions))
## Waiting for profiling to be done...
## 2.5 % 97.5 %
## (Intercept) 7.012769e-02 3.808905e+25
## Age 9.390131e-01 1.258052e+00
## ICUTypeCardiac Surgery Recovery Unit 1.777114e-06 6.971742e+04
## ICUTypeMedical ICU 2.386097e-03 5.774293e+02
## ICUTypeSurgical ICU 3.969907e-03 1.610609e+03
## Albumin_min 5.629314e-02 1.044176e+01
## Bilirubin_max 9.836444e-01 1.116128e+00
## BUN_max 1.010678e+00 1.035413e+00
## GCS_max 7.784320e-01 9.484333e-01
## HR_max 9.985662e-01 1.031991e+00
## Lactate_max 9.188518e-01 1.202185e+00
## Na_min 8.650810e-01 1.010199e+00
## pH_min 3.990579e-03 7.211766e+00
## Temp_min 5.407101e-01 1.004667e+00
## Urine_min 9.857333e-01 1.007534e+00
## WBC_min 1.006646e+00 1.243392e+00
## WBC_max 8.213491e-01 9.736753e-01
## Age:ICUTypeCardiac Surgery Recovery Unit 7.936075e-01 1.145060e+00
## Age:ICUTypeMedical ICU 9.110075e-01 1.088083e+00
## Age:ICUTypeSurgical ICU 8.893233e-01 1.071371e+00
## Age:Albumin_min 9.512142e-01 1.027652e+00
When the final model was re-fitted to the the unimputed data (icu_patients_df0), we see that 1762 observations are removed due to missingness. This is because the default method used by R when attempting to fit a model to a dataset with missing data is to use only the observations with complete data (in this case, only 299 of the original 2061 observations had complete data).
Many of the variables that were significant when fitted to the imputed data, were no longer significant. Only four (compared to ten) predictors remained significant. The profiled 95% confidence intervals were also significantly wider, especially notable in the ICUType variable (upper CI up to nearly 70000!). Therefore, we see that the precision of the estimators in the model is much lower, due to the large amount of lost data to missingness. If one was to pursue using the original dataset with substantial missingness, it would be important to identify any patterns in the missing data to ensure potential sources of bias were identified and accounted for.
In this task, you are required to develop a Cox proportional hazards survival model using the icu_patients_df1 data set which adequately explains or predicts the length of survival indicated by the Days variable, with censoring as indicated by the Status variable. You should fit a series of models, maybe three or four, evaluating each one, before you present your final model. Your final model should not include all the predictor variables, just a small subset of them, which you have selected based on statistical significance and/or background knowledge. Aim for between five and ten predictor variables (slightly more or fewer is OK). It is perfectly acceptable to include predictor variables in your final model which are not statistically significant, as long as you justify their inclusion on medical or physiological grounds (you will not be marked down if your medical justification is not exactly correct, but do you best). You should assess each model you consider for goodness of fit and other relevant statistics, and you should assess your final model for violations of assumptions and perform other diagnostics which you think are relevant (and modify the model if indicated, or at least comment on the possible impact of what your diagnostics show). Finally, re-fit your final model to the unimputed data frame (icu_patients_df0.rds) and comment on any differences you find.
Select an initial subset of explanatory variables that you will use to predict survival. Justify your choice.
Conduct basic exploratory data analysis on your variables of choice.
Fit appropriate univariate Cox proportional hazards models.
Fit an appropriate series of multivariable Cox proportional hazards models, justifying your approach. Assess each model you consider for goodness of fit and other relevant statistics.
Present your final model. Your final model should not include all the predictor variables, just a small subset of them, which you have selected based on statistical significance and/or background knowledge.
For your final model, present a set of diagnostic statistics and/or charts and comment on them.
Write a very brief paragraph summarising the most important findings of your final model. Include the most important values from the statistical output, and a simple clinical interpretation.
The purpose of this task is to understand the impact of information collected during the first 24 hours of an ICU stay on the length of survival of the ICU population (followed up for 2408 days, approximately 6.5 years).
To select an initial subset of explanatory variables, we used the same clinical logic as for Task 1 - to examine the measures used in already validated risk scores: SAPS1, SOFA and APACHE scores.
Therefore, the initial subset of explanatory variables we have chosen for this task are:
DEMOGRAPHIC VARIABLES:
* Age
* Gender
* ICUType
* Height
* Weight_max
* Length_of_stay
CLINICAL VARIABLES:
* Albumin_min
* Bilirubin_max
* BUN_max
* Creatinine_max
* GCS_min
* Glucose_min and Glucose_max
* HCO3_min
* HR_min and HR_max
* K_min and K_max
* Lactate_max
* MAP_min
* Na_min and Na_max
* NISysABP_min and NISysABP_max
* Platelets_min
* FiO2_max and PaO2_min - included as PFratio= PaO2_min/ FiO2_max
* pH_min and pH_max
* RespRate_min and RespRate_max
* Temp_min and Temp_max
* TroponinI_max
* TroponinT_max
* Urine_min
* WBC_min and WBC_max
# Outcome variables
unique_icu = unique(subset(icu_patients_df1, select = c(RecordID)))
dim(unique_icu) # There are 2061 unique individuals
## [1] 2061 1
table(icu_patients_df1$Status) #773 censored out of 2061 observations
##
## FALSE TRUE
## 1288 773
# Plot KM survival curve (non-parametric)
ICU.fit <- survfit( Surv(Days, Status) ~ 1, data = icu_patients_df1)
print(ICU.fit, print.rmean = TRUE)
## Call: survfit(formula = Surv(Days, Status) ~ 1, data = icu_patients_df1)
##
## n events *rmean *se(rmean) median 0.95LCL 0.95UCL
## 2061.0 773.0 1633.5 23.1 NA NA NA
## * restricted mean with upper limit = 2408
#summary(ICU.fit)
plot(ICU.fit, main = 'Kaplan-Meier estimate of survival function', xlab = 'Length of survival (in days)')
# plotting Nelson-Aalen estimate (non-parametric)
plot(ICU.fit, fun="cumhaz", main = "Nelson-Aalen estimate of cumulative hazard function", xlab = 'Length of survival (in days)')
There were 773 deaths (out of 2061 participants) during follow-up.The median follow-up time cannot be determined as the survival rate has not yet dropped to 50% survival at the end of the available data. The cumulative hazard rate (as shown in the Nelson Aalen plot) reaches 47% by the end of the available data.
# Display frequencies for categorical explanatory variables
table(icu_patients_df1$Gender)
##
## Female Male
## 913 1148
table(icu_patients_df1$ICUType)
##
## Coronary Care Unit Cardiac Surgery Recovery Unit
## 297 448
## Medical ICU Surgical ICU
## 788 528
# Display counts, histograms, median and IQRs for continuous explanatory variables
# Create PFratio variable:
icu_patients_df1$PFratio<-icu_patients_df1$PaO2_min/icu_patients_df1$FiO2_max
# Write a function for continuous variable EDA output
cont_eda <- function(variable){
print(paste(variable,'EDA:'))
na_rm <- na.omit(icu_patients_df1[,variable])
neg_val<-icu_patients_df1[variable<0,variable]
print(paste('Number of non-missing values:',length(na_rm)+length(neg_val))) # number of non-missing values
print(paste('Number of missing values:',sum(is.na(icu_patients_df1[,variable])))) # number of missing values
print(quantile(icu_patients_df1[,variable], na.rm=TRUE))
hist(icu_patients_df1[,variable], breaks=20, xlab=variable, main=paste('Histogram of',variable))
}
# Loop through the continuous variables from the chosen list of variables to explore and pass them to the EDA function
cont_vars <- c('Age', 'Length_of_stay', 'Height', 'Weight_max', 'Albumin_min', 'Bilirubin_max',
'BUN_max', 'Creatinine_max', 'GCS_min', 'Glucose_min',
'Glucose_max', 'HCO3_min', 'HR_min', 'HR_max', 'K_min', 'K_max',
'Lactate_max', 'MAP_min', 'Na_min', 'Na_max', 'NISysABP_min',
'NISysABP_max', 'Platelets_min', 'PFratio', 'pH_min', 'pH_max',
'RespRate_min', 'RespRate_max', 'Temp_min', 'Temp_max',
'TroponinI_max', 'TroponinT_max', 'Urine_min', 'WBC_min', 'WBC_max')
par(mfrow=c(12,3)) # set the layout of the histograms in 12 row x 3 column grid
for(i in 1:length(cont_vars)){
cont_eda(cont_vars[i])
}
## [1] "Age EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 16 52 67 78 90
## [1] "Length_of_stay EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## -1 6 10 17 154
## [1] "Height EDA:"
## [1] "Number of non-missing values: 1069"
## [1] "Number of missing values: 992"
## 0% 25% 50% 75% 100%
## 13.0 162.6 170.2 177.8 426.7
## [1] "Weight_max EDA:"
## [1] "Number of non-missing values: 1915"
## [1] "Number of missing values: 146"
## 0% 25% 50% 75% 100%
## 34.60 66.00 80.00 94.55 230.00
## [1] "Albumin_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 1.1 2.6 3.0 3.5 5.3
## [1] "Bilirubin_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0.1 0.4 0.7 1.3 45.9
## [1] "BUN_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 3 14 20 33 197
## [1] "Creatinine_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0.2 0.8 1.0 1.5 22.0
## [1] "GCS_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 3 3 8 14 15
## [1] "Glucose_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 24 98 117 141 632
## [1] "Glucose_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 39 117 141 180 1143
## [1] "HCO3_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 5 20 23 25 44
## [1] "HR_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0 61 71 81 126
## [1] "HR_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 44 91 104 119 300
## [1] "K_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 1.8 3.5 3.9 4.3 6.9
## [1] "K_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 2.5 4.0 4.3 4.7 22.9
## [1] "Lactate_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0.4 1.5 2.2 3.2 29.3
## [1] "MAP_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 1 55 61 70 265
## [1] "Na_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 98 136 138 141 160
## [1] "Na_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 112 137 140 142 177
## [1] "NISysABP_min EDA:"
## [1] "Number of non-missing values: 1608"
## [1] "Number of missing values: 453"
## 0% 25% 50% 75% 100%
## 4 83 95 108 234
## [1] "NISysABP_max EDA:"
## [1] "Number of non-missing values: 1608"
## [1] "Number of missing values: 453"
## 0% 25% 50% 75% 100%
## 78 121 138 156 274
## [1] "Platelets_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 9 126 184 246 891
## [1] "PFratio EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 24 85 122 188 1150
## [1] "pH_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 3.00 7.28 7.34 7.39 7.63
## [1] "pH_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 7.15 7.38 7.42 7.46 7.69
## [1] "RespRate_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 4 12 14 17 24
## [1] "RespRate_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 13 24 27 33 98
## [1] "Temp_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 24.2 35.6 36.1 36.6 38.3
## [1] "Temp_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 35.4 37.1 37.6 38.2 42.1
## [1] "TroponinI_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0.3 2.6 7.8 17.6 43.4
## [1] "TroponinT_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0.01 0.06 0.17 0.80 24.46
## [1] "Urine_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0 0 20 36 600
## [1] "WBC_min EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0.1 7.6 10.4 14.1 128.3
## [1] "WBC_max EDA:"
## [1] "Number of non-missing values: 2061"
## [1] "Number of missing values: 0"
## 0% 25% 50% 75% 100%
## 0.1 9.3 12.3 16.9 155.6
#Check negative values in
neg_val<-icu_patients_df1[icu_patients_df1$Length_of_stay<0,"Length_of_stay"]
length(neg_val)
## [1] 25
EDA Findings:
There are 2061 unique individuals in the dataset. Of these, 913 are female (44%) and 1148 are male (56%).
Medical ICU accounted for 38% of individuals, 26% in Surgical ICU, 24% in Cardiac Surgery recovery Unit and 14% in the Coronary Care unit.
The following variables have a large proportion of missing observations:
Weight_max - 146 missing observationsHeight - 992 missing observationsNISysABP_min & NISysABP_max - 453 missing observationsLength_of_stay - 25 negative valuesThe median values (50% quantile) and IQR (25% - 75% quantiles) are displayed for all continuous variables.
#Plot the Kaplan-Meier survival curves by categorical variables in the data
#Gender
ICU.gender.fit <- survfit( Surv(Days, Status) ~ as.factor(Gender), data = icu_patients_df1)
print(ICU.gender.fit, print.rmean = TRUE)
## Call: survfit(formula = Surv(Days, Status) ~ as.factor(Gender), data = icu_patients_df1)
##
## n events *rmean *se(rmean) median 0.95LCL 0.95UCL
## as.factor(Gender)=Female 913 364 1588 35.2 NA NA NA
## as.factor(Gender)=Male 1148 409 1670 30.6 NA NA NA
## * restricted mean with upper limit = 2408
plot(ICU.gender.fit, col=c("blue", "red"), main = 'Kaplan-Meier estimate of survival function', xlab = 'Length of survival (in days)')
legend("bottomleft", legend=c("Female", "Male"),col=c("blue","red"), lty=1:1,cex=1)
#ICUType
ICU.type.fit <- survfit( Surv(Days, Status) ~ as.factor(ICUType), data = icu_patients_df1)
print(ICU.type.fit, print.rmean = TRUE)
## Call: survfit(formula = Surv(Days, Status) ~ as.factor(ICUType), data = icu_patients_df1)
##
## n events *rmean *se(rmean)
## as.factor(ICUType)=Coronary Care Unit 297 132 1486 63.1
## as.factor(ICUType)=Cardiac Surgery Recovery Unit 448 99 2002 38.9
## as.factor(ICUType)=Medical ICU 788 372 1414 39.3
## as.factor(ICUType)=Surgical ICU 528 170 1731 44.3
## median 0.95LCL 0.95UCL
## as.factor(ICUType)=Coronary Care Unit NA NA NA
## as.factor(ICUType)=Cardiac Surgery Recovery Unit NA NA NA
## as.factor(ICUType)=Medical ICU NA 2051 NA
## as.factor(ICUType)=Surgical ICU NA NA NA
## * restricted mean with upper limit = 2408
plot(ICU.type.fit, col=c("blue", "red","purple","green"), main = 'Kaplan-Meier estimate of survival function', xlab = 'Length of survival (in days)')
legend("bottomleft", legend=c("Coronary Care Unit", "Cardiac Surgery Recovery Unit", "Medical ICU", "Surgical ICU"),col=c("blue","red","purple","green"), lty=1:1,cex=1)
The survival curves above show that risk of mortality is greater for the ICU population that is female than those that are male. Furthermore, ICU population mortality by ICU Type is different - those in Medical ICU have the highest risk of mortality whereas those in Cardiac Surgery Recovery Unit have the lowest. Interestingly, the survival curves look parallel for each category indicating Cox proportional hazards model is an appropriate model for ICU related survival.
# Cox proportional models and Log Rank tests for the chosen variables
# Survival object = Surv(Days, Status)
# Gender
ICU.fitbyGender <- coxph( Surv(Days, Status) ~ as.factor(Gender), data = icu_patients_df1)
summary(ICU.fitbyGender)
## Call:
## coxph(formula = Surv(Days, Status) ~ as.factor(Gender), data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## as.factor(Gender)Male -0.13708 0.87190 0.07206 -1.902 0.0571 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## as.factor(Gender)Male 0.8719 1.147 0.7571 1.004
##
## Concordance= 0.516 (se = 0.009 )
## Likelihood ratio test= 3.61 on 1 df, p=0.06
## Wald test = 3.62 on 1 df, p=0.06
## Score (logrank) test = 3.62 on 1 df, p=0.06
# ICU Type
ICU.fitbytype <- coxph( Surv(Days, Status) ~ as.factor(ICUType), data = icu_patients_df1)
summary(ICU.fitbytype)
## Call:
## coxph(formula = Surv(Days, Status) ~ as.factor(ICUType), data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef)
## as.factor(ICUType)Cardiac Surgery Recovery Unit -0.87895 0.41522 0.13301
## as.factor(ICUType)Medical ICU 0.09362 1.09815 0.10131
## as.factor(ICUType)Surgical ICU -0.39843 0.67137 0.11603
## z Pr(>|z|)
## as.factor(ICUType)Cardiac Surgery Recovery Unit -6.608 3.89e-11 ***
## as.factor(ICUType)Medical ICU 0.924 0.355437
## as.factor(ICUType)Surgical ICU -3.434 0.000595 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95
## as.factor(ICUType)Cardiac Surgery Recovery Unit 0.4152 2.4084 0.3199
## as.factor(ICUType)Medical ICU 1.0981 0.9106 0.9004
## as.factor(ICUType)Surgical ICU 0.6714 1.4895 0.5348
## upper .95
## as.factor(ICUType)Cardiac Surgery Recovery Unit 0.5389
## as.factor(ICUType)Medical ICU 1.3394
## as.factor(ICUType)Surgical ICU 0.8428
##
## Concordance= 0.597 (se = 0.009 )
## Likelihood ratio test= 98.74 on 3 df, p=<2e-16
## Wald test = 87.96 on 3 df, p=<2e-16
## Score (logrank) test = 93.02 on 3 df, p=<2e-16
# Age
ICU.fitbyage <- coxph( Surv(Days, Status) ~ Age, data = icu_patients_df1)
summary(ICU.fitbyage)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Age 0.03355 1.03412 0.00250 13.42 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Age 1.034 0.967 1.029 1.039
##
## Concordance= 0.646 (se = 0.01 )
## Likelihood ratio test= 209.4 on 1 df, p=<2e-16
## Wald test = 180.1 on 1 df, p=<2e-16
## Score (logrank) test = 187 on 1 df, p=<2e-16
# Length_of_stay
ICU.fitbyLoS <- coxph( Surv(Days, Status) ~ Length_of_stay, data = icu_patients_df1)
summary(ICU.fitbyLoS)
## Call:
## coxph(formula = Surv(Days, Status) ~ Length_of_stay, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Length_of_stay 0.010163 1.010215 0.002219 4.579 4.67e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Length_of_stay 1.01 0.9899 1.006 1.015
##
## Concordance= 0.525 (se = 0.011 )
## Likelihood ratio test= 17.5 on 1 df, p=3e-05
## Wald test = 20.97 on 1 df, p=5e-06
## Score (logrank) test = 20.85 on 1 df, p=5e-06
# Height
ICU.fitbyheight <- coxph( Surv(Days, Status) ~ Height, data = icu_patients_df1)
summary(ICU.fitbyheight)
## Call:
## coxph(formula = Surv(Days, Status) ~ Height, data = icu_patients_df1)
##
## n= 1069, number of events= 385
## (992 observations deleted due to missingness)
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Height -0.003851 0.996156 0.002346 -1.642 0.101
##
## exp(coef) exp(-coef) lower .95 upper .95
## Height 0.9962 1.004 0.9916 1.001
##
## Concordance= 0.541 (se = 0.015 )
## Likelihood ratio test= 2.7 on 1 df, p=0.1
## Wald test = 2.69 on 1 df, p=0.1
## Score (logrank) test = 2.52 on 1 df, p=0.1
# Weight_max
ICU.fitbyweightmax <- coxph( Surv(Days, Status) ~ Weight_max, data = icu_patients_df1)
summary(ICU.fitbyweightmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ Weight_max, data = icu_patients_df1)
##
## n= 1915, number of events= 721
## (146 observations deleted due to missingness)
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Weight_max -0.007213 0.992813 0.001759 -4.101 4.11e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Weight_max 0.9928 1.007 0.9894 0.9962
##
## Concordance= 0.56 (se = 0.011 )
## Likelihood ratio test= 17.9 on 1 df, p=2e-05
## Wald test = 16.82 on 1 df, p=4e-05
## Score (logrank) test = 16.71 on 1 df, p=4e-05
# Albumin_min
ICU.fitbyAlbuminmin <- coxph( Surv(Days, Status) ~ Albumin_min, data = icu_patients_df1)
summary(ICU.fitbyAlbuminmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ Albumin_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Albumin_min -0.22075 0.80192 0.05704 -3.87 0.000109 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Albumin_min 0.8019 1.247 0.7171 0.8968
##
## Concordance= 0.54 (se = 0.011 )
## Likelihood ratio test= 15.02 on 1 df, p=1e-04
## Wald test = 14.98 on 1 df, p=1e-04
## Score (logrank) test = 14.99 on 1 df, p=1e-04
# Bilirubin_max
ICU.fitbyBilirubinmax <- coxph( Surv(Days, Status) ~ Bilirubin_max, data = icu_patients_df1)
summary(ICU.fitbyBilirubinmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ Bilirubin_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Bilirubin_max 0.025159 1.025478 0.007431 3.386 0.00071 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Bilirubin_max 1.025 0.9752 1.011 1.041
##
## Concordance= 0.515 (se = 0.011 )
## Likelihood ratio test= 9.48 on 1 df, p=0.002
## Wald test = 11.46 on 1 df, p=7e-04
## Score (logrank) test = 11.7 on 1 df, p=6e-04
# BUN_max
ICU.fitbyBUNmax <- coxph( Surv(Days, Status) ~ BUN_max, data = icu_patients_df1)
summary(ICU.fitbyBUNmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ BUN_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## BUN_max 0.015002 1.015115 0.001064 14.09 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## BUN_max 1.015 0.9851 1.013 1.017
##
## Concordance= 0.647 (se = 0.01 )
## Likelihood ratio test= 142.5 on 1 df, p=<2e-16
## Wald test = 198.6 on 1 df, p=<2e-16
## Score (logrank) test = 207 on 1 df, p=<2e-16
# Creatinine_max
ICU.fitbyCreatininemax <- coxph( Surv(Days, Status) ~ Creatinine_max, data = icu_patients_df1)
summary(ICU.fitbyCreatininemax)
## Call:
## coxph(formula = Surv(Days, Status) ~ Creatinine_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Creatinine_max 0.10152 1.10685 0.01467 6.92 4.5e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Creatinine_max 1.107 0.9035 1.075 1.139
##
## Concordance= 0.594 (se = 0.011 )
## Likelihood ratio test= 35.11 on 1 df, p=3e-09
## Wald test = 47.89 on 1 df, p=5e-12
## Score (logrank) test = 48.54 on 1 df, p=3e-12
# GCS_min
ICU.fitbyGCSmin <- coxph( Surv(Days, Status) ~ GCS_min, data = icu_patients_df1)
summary(ICU.fitbyGCSmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ GCS_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## GCS_min 0.006052 1.006070 0.007324 0.826 0.409
##
## exp(coef) exp(-coef) lower .95 upper .95
## GCS_min 1.006 0.994 0.9917 1.021
##
## Concordance= 0.501 (se = 0.01 )
## Likelihood ratio test= 0.68 on 1 df, p=0.4
## Wald test = 0.68 on 1 df, p=0.4
## Score (logrank) test = 0.68 on 1 df, p=0.4
# Glucose - min & max
ICU.fitbyGlucosemin <- coxph( Surv(Days, Status) ~ Glucose_min, data = icu_patients_df1)
summary(ICU.fitbyGlucosemin)
## Call:
## coxph(formula = Surv(Days, Status) ~ Glucose_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Glucose_min 0.0014076 1.0014086 0.0007477 1.883 0.0597 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Glucose_min 1.001 0.9986 0.9999 1.003
##
## Concordance= 0.508 (se = 0.011 )
## Likelihood ratio test= 3.31 on 1 df, p=0.07
## Wald test = 3.54 on 1 df, p=0.06
## Score (logrank) test = 3.53 on 1 df, p=0.06
ICU.fitbyGlucosemax <- coxph( Surv(Days, Status) ~ Glucose_max, data = icu_patients_df1)
summary(ICU.fitbyGlucosemax)
## Call:
## coxph(formula = Surv(Days, Status) ~ Glucose_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Glucose_max 0.0012981 1.0012989 0.0003245 4 6.34e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Glucose_max 1.001 0.9987 1.001 1.002
##
## Concordance= 0.547 (se = 0.011 )
## Likelihood ratio test= 13.2 on 1 df, p=3e-04
## Wald test = 16 on 1 df, p=6e-05
## Score (logrank) test = 15.96 on 1 df, p=6e-05
# HCO3_min
ICU.fitbyHCO3min <- coxph( Surv(Days, Status) ~ HCO3_min, data = icu_patients_df1)
summary(ICU.fitbyHCO3min)
## Call:
## coxph(formula = Surv(Days, Status) ~ HCO3_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## HCO3_min -0.017036 0.983108 0.008023 -2.123 0.0337 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## HCO3_min 0.9831 1.017 0.9678 0.9987
##
## Concordance= 0.535 (se = 0.011 )
## Likelihood ratio test= 4.49 on 1 df, p=0.03
## Wald test = 4.51 on 1 df, p=0.03
## Score (logrank) test = 4.5 on 1 df, p=0.03
# HR - min & max
ICU.fitbyHRmin <- coxph( Surv(Days, Status) ~ HR_min, data = icu_patients_df1)
summary(ICU.fitbyHRmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ HR_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## HR_min -0.0009841 0.9990164 0.0024165 -0.407 0.684
##
## exp(coef) exp(-coef) lower .95 upper .95
## HR_min 0.999 1.001 0.9943 1.004
##
## Concordance= 0.498 (se = 0.011 )
## Likelihood ratio test= 0.17 on 1 df, p=0.7
## Wald test = 0.17 on 1 df, p=0.7
## Score (logrank) test = 0.17 on 1 df, p=0.7
ICU.fitbyHRmax <- coxph( Surv(Days, Status) ~ HR_max, data = icu_patients_df1)
summary(ICU.fitbyHRmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ HR_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## HR_max 0.002779 1.002783 0.001648 1.687 0.0916 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## HR_max 1.003 0.9972 0.9996 1.006
##
## Concordance= 0.515 (se = 0.011 )
## Likelihood ratio test= 2.79 on 1 df, p=0.09
## Wald test = 2.85 on 1 df, p=0.09
## Score (logrank) test = 2.84 on 1 df, p=0.09
# K - min & max
ICU.fitbyKmin <- coxph( Surv(Days, Status) ~ K_min, data = icu_patients_df1)
summary(ICU.fitbyKmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ K_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## K_min 0.03906 1.03983 0.06125 0.638 0.524
##
## exp(coef) exp(-coef) lower .95 upper .95
## K_min 1.04 0.9617 0.9222 1.172
##
## Concordance= 0.502 (se = 0.011 )
## Likelihood ratio test= 0.41 on 1 df, p=0.5
## Wald test = 0.41 on 1 df, p=0.5
## Score (logrank) test = 0.41 on 1 df, p=0.5
ICU.fitbyKmax <- coxph( Surv(Days, Status) ~ K_max, data = icu_patients_df1)
summary(ICU.fitbyKmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ K_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## K_max 0.07306 1.07579 0.02958 2.469 0.0135 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## K_max 1.076 0.9295 1.015 1.14
##
## Concordance= 0.527 (se = 0.011 )
## Likelihood ratio test= 4.81 on 1 df, p=0.03
## Wald test = 6.1 on 1 df, p=0.01
## Score (logrank) test = 5.98 on 1 df, p=0.01
# Lactate_max
ICU.fitbyLactatemax <- coxph( Surv(Days, Status) ~ Lactate_max, data = icu_patients_df1)
summary(ICU.fitbyLactatemax)
## Call:
## coxph(formula = Surv(Days, Status) ~ Lactate_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Lactate_max 0.05778 1.05948 0.01666 3.467 0.000526 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Lactate_max 1.059 0.9439 1.025 1.095
##
## Concordance= 0.508 (se = 0.011 )
## Likelihood ratio test= 10.95 on 1 df, p=9e-04
## Wald test = 12.02 on 1 df, p=5e-04
## Score (logrank) test = 12.03 on 1 df, p=5e-04
# MAP_min
ICU.fitbyMAPmin <- coxph( Surv(Days, Status) ~ MAP_min, data = icu_patients_df1)
summary(ICU.fitbyMAPmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ MAP_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## MAP_min -0.004744 0.995267 0.002326 -2.04 0.0414 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## MAP_min 0.9953 1.005 0.9907 0.9998
##
## Concordance= 0.52 (se = 0.01 )
## Likelihood ratio test= 4.37 on 1 df, p=0.04
## Wald test = 4.16 on 1 df, p=0.04
## Score (logrank) test = 4.07 on 1 df, p=0.04
# Na - min & max
ICU.fitbyNamin <- coxph( Surv(Days, Status) ~ Na_min, data = icu_patients_df1)
summary(ICU.fitbyNamin)
## Call:
## coxph(formula = Surv(Days, Status) ~ Na_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Na_min -0.021187 0.979036 0.007371 -2.875 0.00405 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Na_min 0.979 1.021 0.965 0.9933
##
## Concordance= 0.536 (se = 0.011 )
## Likelihood ratio test= 7.74 on 1 df, p=0.005
## Wald test = 8.26 on 1 df, p=0.004
## Score (logrank) test = 8.16 on 1 df, p=0.004
ICU.fitbyNamax <- coxph( Surv(Days, Status) ~ Na_max, data = icu_patients_df1)
summary(ICU.fitbyNamax)
## Call:
## coxph(formula = Surv(Days, Status) ~ Na_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Na_max -0.015698 0.984424 0.008287 -1.894 0.0582 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Na_max 0.9844 1.016 0.9686 1.001
##
## Concordance= 0.521 (se = 0.011 )
## Likelihood ratio test= 3.61 on 1 df, p=0.06
## Wald test = 3.59 on 1 df, p=0.06
## Score (logrank) test = 3.57 on 1 df, p=0.06
# NISysABP - min & max
ICU.fitbyNISysABPmin <- coxph( Surv(Days, Status) ~ NISysABP_min, data = icu_patients_df1)
summary(ICU.fitbyNISysABPmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ NISysABP_min, data = icu_patients_df1)
##
## n= 1608, number of events= 651
## (453 observations deleted due to missingness)
##
## coef exp(coef) se(coef) z Pr(>|z|)
## NISysABP_min -0.007374 0.992653 0.001994 -3.699 0.000216 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## NISysABP_min 0.9927 1.007 0.9888 0.9965
##
## Concordance= 0.555 (se = 0.012 )
## Likelihood ratio test= 14 on 1 df, p=2e-04
## Wald test = 13.68 on 1 df, p=2e-04
## Score (logrank) test = 13.54 on 1 df, p=2e-04
ICU.fitbyNISysABPmax <- coxph( Surv(Days, Status) ~ NISysABP_max, data = icu_patients_df1)
summary(ICU.fitbyNISysABPmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ NISysABP_max, data = icu_patients_df1)
##
## n= 1608, number of events= 651
## (453 observations deleted due to missingness)
##
## coef exp(coef) se(coef) z Pr(>|z|)
## NISysABP_max 0.003503 1.003509 0.001402 2.498 0.0125 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## NISysABP_max 1.004 0.9965 1.001 1.006
##
## Concordance= 0.523 (se = 0.012 )
## Likelihood ratio test= 6.12 on 1 df, p=0.01
## Wald test = 6.24 on 1 df, p=0.01
## Score (logrank) test = 6.24 on 1 df, p=0.01
# Platelets_min
ICU.fitbyPlateletsmin <- coxph( Surv(Days, Status) ~ Platelets_min, data = icu_patients_df1)
summary(ICU.fitbyPlateletsmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ Platelets_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Platelets_min 0.0001735 1.0001735 0.0003440 0.504 0.614
##
## exp(coef) exp(-coef) lower .95 upper .95
## Platelets_min 1 0.9998 0.9995 1.001
##
## Concordance= 0.499 (se = 0.011 )
## Likelihood ratio test= 0.25 on 1 df, p=0.6
## Wald test = 0.25 on 1 df, p=0.6
## Score (logrank) test = 0.25 on 1 df, p=0.6
# PFratio (PaO2_min/FiO2_max)
ICU.fitbyPFratio <- coxph( Surv(Days, Status) ~ PFratio, data = icu_patients_df1)
summary(ICU.fitbyPFratio)
## Call:
## coxph(formula = Surv(Days, Status) ~ PFratio, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## PFratio -0.0002469 0.9997531 0.0003579 -0.69 0.49
##
## exp(coef) exp(-coef) lower .95 upper .95
## PFratio 0.9998 1 0.9991 1
##
## Concordance= 0.513 (se = 0.011 )
## Likelihood ratio test= 0.49 on 1 df, p=0.5
## Wald test = 0.48 on 1 df, p=0.5
## Score (logrank) test = 0.48 on 1 df, p=0.5
# pH - min & max
ICU.fitbypHmin <- coxph( Surv(Days, Status) ~ pH_min, data = icu_patients_df1)
summary(ICU.fitbypHmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ pH_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## pH_min -0.6668 0.5133 0.1717 -3.884 0.000103 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## pH_min 0.5133 1.948 0.3667 0.7187
##
## Concordance= 0.51 (se = 0.011 )
## Likelihood ratio test= 8.34 on 1 df, p=0.004
## Wald test = 15.09 on 1 df, p=1e-04
## Score (logrank) test = 14.09 on 1 df, p=2e-04
ICU.fitbypHmax <- coxph( Surv(Days, Status) ~ pH_max, data = icu_patients_df1)
summary(ICU.fitbypHmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ pH_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## pH_max -1.3288 0.2648 0.5512 -2.411 0.0159 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## pH_max 0.2648 3.776 0.0899 0.78
##
## Concordance= 0.524 (se = 0.011 )
## Likelihood ratio test= 5.78 on 1 df, p=0.02
## Wald test = 5.81 on 1 df, p=0.02
## Score (logrank) test = 5.81 on 1 df, p=0.02
# RespRate - min & max
ICU.fitbyRespRatemin <- coxph( Surv(Days, Status) ~ RespRate_min, data = icu_patients_df1)
summary(ICU.fitbyRespRatemin)
## Call:
## coxph(formula = Surv(Days, Status) ~ RespRate_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## RespRate_min 0.042945 1.043880 0.009451 4.544 5.52e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## RespRate_min 1.044 0.958 1.025 1.063
##
## Concordance= 0.555 (se = 0.01 )
## Likelihood ratio test= 20.44 on 1 df, p=6e-06
## Wald test = 20.65 on 1 df, p=6e-06
## Score (logrank) test = 20.67 on 1 df, p=5e-06
ICU.fitbyRespRatemax <- coxph( Surv(Days, Status) ~ RespRate_max, data = icu_patients_df1)
summary(ICU.fitbyRespRatemax)
## Call:
## coxph(formula = Surv(Days, Status) ~ RespRate_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## RespRate_max 0.01472 1.01483 0.00432 3.407 0.000657 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## RespRate_max 1.015 0.9854 1.006 1.023
##
## Concordance= 0.535 (se = 0.011 )
## Likelihood ratio test= 10.93 on 1 df, p=9e-04
## Wald test = 11.61 on 1 df, p=7e-04
## Score (logrank) test = 11.54 on 1 df, p=7e-04
# Temp - min & max
ICU.fitbyTempmin <- coxph( Surv(Days, Status) ~ Temp_min, data = icu_patients_df1)
summary(ICU.fitbyTempmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ Temp_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Temp_min -0.10541 0.89996 0.03894 -2.707 0.00679 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Temp_min 0.9 1.111 0.8338 0.9713
##
## Concordance= 0.528 (se = 0.011 )
## Likelihood ratio test= 6.85 on 1 df, p=0.009
## Wald test = 7.33 on 1 df, p=0.007
## Score (logrank) test = 7.21 on 1 df, p=0.007
ICU.fitbyTempmax <- coxph( Surv(Days, Status) ~ Temp_max, data = icu_patients_df1)
summary(ICU.fitbyTempmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ Temp_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Temp_max -0.1966 0.8215 0.0493 -3.988 6.68e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Temp_max 0.8215 1.217 0.7459 0.9049
##
## Concordance= 0.55 (se = 0.011 )
## Likelihood ratio test= 16.34 on 1 df, p=5e-05
## Wald test = 15.9 on 1 df, p=7e-05
## Score (logrank) test = 15.89 on 1 df, p=7e-05
# Troponin_max (I and T assays)
ICU.fitbyTroponinImax <- coxph( Surv(Days, Status) ~ TroponinI_max, data = icu_patients_df1)
summary(ICU.fitbyTroponinImax)
## Call:
## coxph(formula = Surv(Days, Status) ~ TroponinI_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## TroponinI_max -9.050e-06 1.000e+00 3.241e-03 -0.003 0.998
##
## exp(coef) exp(-coef) lower .95 upper .95
## TroponinI_max 1 1 0.9937 1.006
##
## Concordance= 0.508 (se = 0.011 )
## Likelihood ratio test= 0 on 1 df, p=1
## Wald test = 0 on 1 df, p=1
## Score (logrank) test = 0 on 1 df, p=1
ICU.fitbyTroponinTmax <- coxph( Surv(Days, Status) ~ TroponinT_max, data = icu_patients_df1)
summary(ICU.fitbyTroponinTmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ TroponinT_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## TroponinT_max 0.04152 1.04239 0.01583 2.623 0.00871 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## TroponinT_max 1.042 0.9593 1.011 1.075
##
## Concordance= 0.525 (se = 0.01 )
## Likelihood ratio test= 6 on 1 df, p=0.01
## Wald test = 6.88 on 1 df, p=0.009
## Score (logrank) test = 6.89 on 1 df, p=0.009
# Urine_min
ICU.fitbyUrinemin <- coxph( Surv(Days, Status) ~ Urine_min, data = icu_patients_df1)
summary(ICU.fitbyUrinemin)
## Call:
## coxph(formula = Surv(Days, Status) ~ Urine_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Urine_min -0.0019252 0.9980767 0.0007179 -2.682 0.00733 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Urine_min 0.9981 1.002 0.9967 0.9995
##
## Concordance= 0.525 (se = 0.01 )
## Likelihood ratio test= 8.51 on 1 df, p=0.004
## Wald test = 7.19 on 1 df, p=0.007
## Score (logrank) test = 7.23 on 1 df, p=0.007
# WBC - min & max
ICU.fitbyWBCmin <- coxph( Surv(Days, Status) ~ WBC_min, data = icu_patients_df1)
summary(ICU.fitbyWBCmin)
## Call:
## coxph(formula = Surv(Days, Status) ~ WBC_min, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## WBC_min 0.009102 1.009144 0.004755 1.914 0.0556 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## WBC_min 1.009 0.9909 0.9998 1.019
##
## Concordance= 0.501 (se = 0.011 )
## Likelihood ratio test= 3.18 on 1 df, p=0.07
## Wald test = 3.66 on 1 df, p=0.06
## Score (logrank) test = 3.59 on 1 df, p=0.06
ICU.fitbyWBCmax <- coxph( Surv(Days, Status) ~ WBC_max, data = icu_patients_df1)
summary(ICU.fitbyWBCmax)
## Call:
## coxph(formula = Surv(Days, Status) ~ WBC_max, data = icu_patients_df1)
##
## n= 2061, number of events= 773
##
## coef exp(coef) se(coef) z Pr(>|z|)
## WBC_max 0.003928 1.003936 0.004294 0.915 0.36
##
## exp(coef) exp(-coef) lower .95 upper .95
## WBC_max 1.004 0.9961 0.9955 1.012
##
## Concordance= 0.491 (se = 0.011 )
## Likelihood ratio test= 0.79 on 1 df, p=0.4
## Wald test = 0.84 on 1 df, p=0.4
## Score (logrank) test = 0.83 on 1 df, p=0.4
Univariable Cox model interpretation by Variable:
Gender - non-significant log-rank test (p-value = 0.06), means that the null hypothesis of no difference in survival between genders is not rejected with a conclusion that survival does not significantly differ by gender.
ICUType - significant log-rank test (p-value close to 0), means that the null hypothesis is rejected with a conclusion that survival significantly differs by each ICU Type. Note that, hazard rate for those in Medical ICU is not statistically significantly different for those in Coronary Care Unit.
Age - significant log-rank test (p-value close to 0), means that the null hypothesis is rejected with a conclusion that survival significantly differs by individual’s age. For every year older in age, the risk of mortality increases by approximately 3%.
Length_of_stay - significant log-rank test (p-value = 0.000005), means that the null hypothesis is rejected with a conclusion that survival significantly differs by individual’s length of stay in hospital. For every extra day in hospital, the risk of mortality increases by approximately 1%.
Height - non-significant log-rank test (p-value = 0.1), means that the null hypothesis of no difference in survival for varying heights is not rejected with a conclusion that survival does not significantly differ by height.
Weight_max - significant log-rank test (p-value = 0.00004) indicating that the null hypothesis is rejected with a conclusion that survival significantly differs by weight. For every additional kilogram, the risk of mortality reduces by approximately 1%. The use of a centered variable may make it easier to interpret.
Clinical measures where the log-rank test results in a rejection of the null hypothesis (p-value <0.05) arguing for the variables’ significance in predicting survival times are:
Albumin_minBilirubin_maxCreatinineBUN_maxCreatinine_maxGlucose_maxHCO3_minK_maxLactate_maxMAP_minNa_minNISysABP_min & NISysABP_maxpH_min & pH_maxRespRate_min & RespRate_maxTemp_min & Temp_maxTroponinT_maxUrine_min## As in Task 1, create a dataset without missing or invalid data to use to build the model ##
## in order to remain consistent and allow comparisons between models to be made ##
# Check counts of missing data in each variable
for(i in 1:length(colnames(icu_patients_df1))){
print(c(i,colnames(icu_patients_df1[i]), sum(is.na(icu_patients_df1[i]))))
}
## [1] "1" "RecordID" "0"
## [1] "2" "Length_of_stay" "0"
## [1] "3" "SAPS1" "96"
## [1] "4" "SOFA" "0"
## [1] "5" "Survival" "1288"
## [1] "6" "in_hospital_death" "0"
## [1] "7" "Days" "0"
## [1] "8" "Status" "0"
## [1] "9" "Age" "0"
## [1] "10" "Albumin_diff" "0"
## [1] "11" "Albumin_max" "0"
## [1] "12" "Albumin_min" "0"
## [1] "13" "ALP_diff" "0"
## [1] "14" "ALP_max" "0"
## [1] "15" "ALP_min" "0"
## [1] "16" "ALT_diff" "0"
## [1] "17" "ALT_max" "0"
## [1] "18" "ALT_min" "0"
## [1] "19" "AST_diff" "0"
## [1] "20" "AST_max" "0"
## [1] "21" "AST_min" "0"
## [1] "22" "Bilirubin_diff" "0"
## [1] "23" "Bilirubin_max" "0"
## [1] "24" "Bilirubin_min" "0"
## [1] "25" "BUN_diff" "0"
## [1] "26" "BUN_max" "0"
## [1] "27" "BUN_min" "0"
## [1] "28" "Cholesterol_diff" "0"
## [1] "29" "Cholesterol_max" "0"
## [1] "30" "Cholesterol_min" "0"
## [1] "31" "Creatinine_diff" "0"
## [1] "32" "Creatinine_max" "0"
## [1] "33" "Creatinine_min" "0"
## [1] "34" "DiasABP_diff" "715"
## [1] "35" "DiasABP_max" "715"
## [1] "36" "DiasABP_min" "715"
## [1] "37" "FiO2_diff" "0"
## [1] "38" "FiO2_max" "0"
## [1] "39" "FiO2_min" "0"
## [1] "40" "GCS_diff" "0"
## [1] "41" "GCS_max" "0"
## [1] "42" "GCS_min" "0"
## [1] "43" "Gender" "0"
## [1] "44" "Glucose_diff" "0"
## [1] "45" "Glucose_max" "0"
## [1] "46" "Glucose_min" "0"
## [1] "47" "HCO3_diff" "0"
## [1] "48" "HCO3_max" "0"
## [1] "49" "HCO3_min" "0"
## [1] "50" "HCT_diff" "0"
## [1] "51" "HCT_max" "0"
## [1] "52" "HCT_min" "0"
## [1] "53" "Height" "992"
## [1] "54" "HR_diff" "0"
## [1] "55" "HR_max" "0"
## [1] "56" "HR_min" "0"
## [1] "57" "ICUType" "0"
## [1] "58" "K_diff" "0"
## [1] "59" "K_max" "0"
## [1] "60" "K_min" "0"
## [1] "61" "Lactate_diff" "0"
## [1] "62" "Lactate_max" "0"
## [1] "63" "Lactate_min" "0"
## [1] "64" "MAP_diff" "0"
## [1] "65" "MAP_max" "0"
## [1] "66" "MAP_min" "0"
## [1] "67" "Mg_diff" "0"
## [1] "68" "Mg_max" "0"
## [1] "69" "Mg_min" "0"
## [1] "70" "Na_diff" "0"
## [1] "71" "Na_max" "0"
## [1] "72" "Na_min" "0"
## [1] "73" "NIDiasABP_diff" "455"
## [1] "74" "NIDiasABP_max" "455"
## [1] "75" "NIDiasABP_min" "455"
## [1] "76" "NIMAP_diff" "455"
## [1] "77" "NIMAP_max" "455"
## [1] "78" "NIMAP_min" "455"
## [1] "79" "NISysABP_diff" "453"
## [1] "80" "NISysABP_max" "453"
## [1] "81" "NISysABP_min" "453"
## [1] "82" "PaCO2_diff" "0"
## [1] "83" "PaCO2_max" "0"
## [1] "84" "PaCO2_min" "0"
## [1] "85" "PaO2_diff" "0"
## [1] "86" "PaO2_max" "0"
## [1] "87" "PaO2_min" "0"
## [1] "88" "pH_diff" "0"
## [1] "89" "pH_max" "0"
## [1] "90" "pH_min" "0"
## [1] "91" "Platelets_diff" "0"
## [1] "92" "Platelets_max" "0"
## [1] "93" "Platelets_min" "0"
## [1] "94" "RespRate_diff" "0"
## [1] "95" "RespRate_max" "0"
## [1] "96" "RespRate_min" "0"
## [1] "97" "SaO2_diff" "0"
## [1] "98" "SaO2_max" "0"
## [1] "99" "SaO2_min" "0"
## [1] "100" "SysABP_diff" "715"
## [1] "101" "SysABP_max" "715"
## [1] "102" "SysABP_min" "715"
## [1] "103" "Temp_diff" "0"
## [1] "104" "Temp_max" "0"
## [1] "105" "Temp_min" "0"
## [1] "106" "TroponinI_diff" "0"
## [1] "107" "TroponinI_max" "0"
## [1] "108" "TroponinI_min" "0"
## [1] "109" "TroponinT_diff" "0"
## [1] "110" "TroponinT_max" "0"
## [1] "111" "TroponinT_min" "0"
## [1] "112" "Urine_diff" "0"
## [1] "113" "Urine_max" "0"
## [1] "114" "Urine_min" "0"
## [1] "115" "WBC_diff" "0"
## [1] "116" "WBC_max" "0"
## [1] "117" "WBC_min" "0"
## [1] "118" "Weight_diff" "146"
## [1] "119" "Weight_max" "146"
## [1] "120" "Weight_min" "146"
## [1] "121" "PFratio" "0"
## Result: of the variables chosen to explore for the survival model, large amounts of missing data in:
## Height (992), NISysABP_min (453), NISysABP_max (453), Weight_max (146)
## Decision: include Weight_max; remove Height, NISysABP_min, NISysABP_max
# Check counts of negative data (noted some -1 values) in each variable
for(i in 1:length(colnames(icu_patients_df1))){
print(c(i,colnames(icu_patients_df1[i]), sum(icu_patients_df1[i] < 0)))
}
## [1] "1" "RecordID" "0"
## [1] "2" "Length_of_stay" "25"
## [1] "3" "SAPS1" NA
## [1] "4" "SOFA" "65"
## [1] "5" "Survival" NA
## [1] "6" "in_hospital_death" "0"
## [1] "7" "Days" "0"
## [1] "8" "Status" "0"
## [1] "9" "Age" "0"
## [1] "10" "Albumin_diff" "0"
## [1] "11" "Albumin_max" "0"
## [1] "12" "Albumin_min" "0"
## [1] "13" "ALP_diff" "0"
## [1] "14" "ALP_max" "0"
## [1] "15" "ALP_min" "0"
## [1] "16" "ALT_diff" "0"
## [1] "17" "ALT_max" "0"
## [1] "18" "ALT_min" "0"
## [1] "19" "AST_diff" "0"
## [1] "20" "AST_max" "0"
## [1] "21" "AST_min" "0"
## [1] "22" "Bilirubin_diff" "0"
## [1] "23" "Bilirubin_max" "0"
## [1] "24" "Bilirubin_min" "0"
## [1] "25" "BUN_diff" "0"
## [1] "26" "BUN_max" "0"
## [1] "27" "BUN_min" "0"
## [1] "28" "Cholesterol_diff" "0"
## [1] "29" "Cholesterol_max" "0"
## [1] "30" "Cholesterol_min" "0"
## [1] "31" "Creatinine_diff" "0"
## [1] "32" "Creatinine_max" "0"
## [1] "33" "Creatinine_min" "0"
## [1] "34" "DiasABP_diff" NA
## [1] "35" "DiasABP_max" NA
## [1] "36" "DiasABP_min" NA
## [1] "37" "FiO2_diff" "0"
## [1] "38" "FiO2_max" "0"
## [1] "39" "FiO2_min" "0"
## [1] "40" "GCS_diff" "0"
## [1] "41" "GCS_max" "0"
## [1] "42" "GCS_min" "0"
## Warning in Ops.factor(left, right): '<' not meaningful for factors
## [1] "43" "Gender" NA
## [1] "44" "Glucose_diff" "0"
## [1] "45" "Glucose_max" "0"
## [1] "46" "Glucose_min" "0"
## [1] "47" "HCO3_diff" "0"
## [1] "48" "HCO3_max" "0"
## [1] "49" "HCO3_min" "0"
## [1] "50" "HCT_diff" "0"
## [1] "51" "HCT_max" "0"
## [1] "52" "HCT_min" "0"
## [1] "53" "Height" NA
## [1] "54" "HR_diff" "0"
## [1] "55" "HR_max" "0"
## [1] "56" "HR_min" "0"
## Warning in Ops.factor(left, right): '<' not meaningful for factors
## [1] "57" "ICUType" NA
## [1] "58" "K_diff" "0"
## [1] "59" "K_max" "0"
## [1] "60" "K_min" "0"
## [1] "61" "Lactate_diff" "0"
## [1] "62" "Lactate_max" "0"
## [1] "63" "Lactate_min" "0"
## [1] "64" "MAP_diff" "0"
## [1] "65" "MAP_max" "0"
## [1] "66" "MAP_min" "0"
## [1] "67" "Mg_diff" "0"
## [1] "68" "Mg_max" "0"
## [1] "69" "Mg_min" "0"
## [1] "70" "Na_diff" "0"
## [1] "71" "Na_max" "0"
## [1] "72" "Na_min" "0"
## [1] "73" "NIDiasABP_diff" NA
## [1] "74" "NIDiasABP_max" NA
## [1] "75" "NIDiasABP_min" NA
## [1] "76" "NIMAP_diff" NA
## [1] "77" "NIMAP_max" NA
## [1] "78" "NIMAP_min" NA
## [1] "79" "NISysABP_diff" NA
## [1] "80" "NISysABP_max" NA
## [1] "81" "NISysABP_min" NA
## [1] "82" "PaCO2_diff" "0"
## [1] "83" "PaCO2_max" "0"
## [1] "84" "PaCO2_min" "0"
## [1] "85" "PaO2_diff" "0"
## [1] "86" "PaO2_max" "0"
## [1] "87" "PaO2_min" "0"
## [1] "88" "pH_diff" "0"
## [1] "89" "pH_max" "0"
## [1] "90" "pH_min" "0"
## [1] "91" "Platelets_diff" "0"
## [1] "92" "Platelets_max" "0"
## [1] "93" "Platelets_min" "0"
## [1] "94" "RespRate_diff" "0"
## [1] "95" "RespRate_max" "0"
## [1] "96" "RespRate_min" "0"
## [1] "97" "SaO2_diff" "0"
## [1] "98" "SaO2_max" "0"
## [1] "99" "SaO2_min" "0"
## [1] "100" "SysABP_diff" NA
## [1] "101" "SysABP_max" NA
## [1] "102" "SysABP_min" NA
## [1] "103" "Temp_diff" "0"
## [1] "104" "Temp_max" "0"
## [1] "105" "Temp_min" "0"
## [1] "106" "TroponinI_diff" "0"
## [1] "107" "TroponinI_max" "0"
## [1] "108" "TroponinI_min" "0"
## [1] "109" "TroponinT_diff" "0"
## [1] "110" "TroponinT_max" "0"
## [1] "111" "TroponinT_min" "0"
## [1] "112" "Urine_diff" "0"
## [1] "113" "Urine_max" "0"
## [1] "114" "Urine_min" "0"
## [1] "115" "WBC_diff" "0"
## [1] "116" "WBC_max" "0"
## [1] "117" "WBC_min" "0"
## [1] "118" "Weight_diff" NA
## [1] "119" "Weight_max" NA
## [1] "120" "Weight_min" NA
## [1] "121" "PFratio" "0"
## Result: negative values in Length_of_stay and SOFA (not listed in initial choice of variables)
# Create a new dataset with the only non-missing data from list of initial variables chosen
# (excluding those with very high missingness i.e. Height, NISysABP_min, NISysABP_max)
nm_icu_model_df1 <- na.omit(subset(icu_patients_df1,
select=c(Days, Status, # the survival object variables
RecordID, # keep record id for reference if needed
in_hospital_death, # from task 1
Age, Length_of_stay, Gender, ICUType, Weight_max,
Albumin_min, Bilirubin_max,
BUN_max, Creatinine_max,
GCS_max, Glucose_min, Glucose_max,
HCO3_min, HR_min, HR_max, K_min,
K_max, Lactate_max, MAP_min, Na_min,
Na_max, Platelets_min, PFratio, pH_min,
pH_max, RespRate_min, RespRate_max,
Temp_min, Temp_max, TroponinT_max,
TroponinI_max, Urine_min, WBC_min, WBC_max)))
dim(nm_icu_model_df1)
## [1] 1915 38
# Also exclude the negative data in Length_of_stay
nm_icu_model_df1<-nm_icu_model_df1[nm_icu_model_df1$Length_of_stay>=0,]
dim(nm_icu_model_df1)
## [1] 1891 38
Due to the high degree of missingness, NISysABP_min, NISysABP_max and Height variables will be excluded from the multivariate modelling. The negative values of Length_of_stay are also removed. After removing missing and negative values, the resulting dataset used to fit multivariable models has 1891 observations.
## Fitting multivariable models ##
# Create a function to calculate AIC
calc_aic <- function(model){
AIC <- 2*length(model$coefficients)-2*model$loglik[2]
}
# Full model using all listed initial variables (excluding those with high missingness)
ICU.mv_full <- coxph(Surv(Days, Status) ~
Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max +
BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max +
HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min +
Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max +
RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max +
TroponinI_max + Urine_min + WBC_min + WBC_max,
data = nm_icu_model_df1)
summary(ICU.mv_full)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + Length_of_stay + Gender +
## ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max +
## Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min +
## HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min +
## Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max +
## RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max +
## TroponinI_max + Urine_min + WBC_min + WBC_max, data = nm_icu_model_df1)
##
## n= 1891, number of events= 718
##
## coef exp(coef) se(coef) z
## Age 3.315e-02 1.034e+00 2.955e-03 11.221
## Length_of_stay 3.761e-03 1.004e+00 2.921e-03 1.288
## GenderMale -2.875e-02 9.717e-01 8.230e-02 -0.349
## ICUTypeCardiac Surgery Recovery Unit -7.874e-01 4.550e-01 1.650e-01 -4.771
## ICUTypeMedical ICU 3.051e-01 1.357e+00 1.183e-01 2.579
## ICUTypeSurgical ICU -5.563e-02 9.459e-01 1.398e-01 -0.398
## Weight_max -2.946e-03 9.971e-01 1.942e-03 -1.517
## Albumin_min -1.205e-01 8.865e-01 6.651e-02 -1.811
## Bilirubin_max 1.466e-02 1.015e+00 7.978e-03 1.837
## BUN_max 1.104e-02 1.011e+00 2.027e-03 5.446
## Creatinine_max -1.528e-02 9.848e-01 2.788e-02 -0.548
## GCS_max -1.075e-01 8.981e-01 1.474e-02 -7.290
## Glucose_min 5.123e-05 1.000e+00 9.759e-04 0.052
## Glucose_max 5.820e-04 1.001e+00 5.638e-04 1.032
## HCO3_min 2.112e-02 1.021e+00 9.645e-03 2.190
## HR_min 5.685e-03 1.006e+00 3.073e-03 1.850
## HR_max 1.602e-03 1.002e+00 2.015e-03 0.795
## K_min 5.379e-02 1.055e+00 8.112e-02 0.663
## K_max -2.861e-02 9.718e-01 4.498e-02 -0.636
## Lactate_max 3.993e-02 1.041e+00 2.050e-02 1.948
## MAP_min -1.142e-03 9.989e-01 2.436e-03 -0.469
## Na_min -4.808e-03 9.952e-01 1.852e-02 -0.260
## Na_max -3.300e-02 9.675e-01 1.861e-02 -1.773
## Platelets_min -4.568e-04 9.995e-01 4.312e-04 -1.059
## PFratio -4.841e-05 1.000e+00 3.968e-04 -0.122
## pH_min -4.926e-01 6.110e-01 1.993e-01 -2.472
## pH_max 2.617e-01 1.299e+00 6.755e-01 0.387
## RespRate_min -1.589e-02 9.842e-01 1.308e-02 -1.215
## RespRate_max 7.390e-03 1.007e+00 6.243e-03 1.184
## Temp_min -4.140e-02 9.595e-01 4.879e-02 -0.848
## Temp_max -1.379e-01 8.712e-01 5.746e-02 -2.401
## TroponinT_max 1.903e-02 1.019e+00 1.819e-02 1.046
## TroponinI_max 2.869e-03 1.003e+00 4.003e-03 0.717
## Urine_min -1.742e-03 9.983e-01 9.673e-04 -1.801
## WBC_min 2.716e-02 1.028e+00 1.463e-02 1.856
## WBC_max -2.103e-02 9.792e-01 1.209e-02 -1.739
## Pr(>|z|)
## Age < 2e-16 ***
## Length_of_stay 0.19790
## GenderMale 0.72684
## ICUTypeCardiac Surgery Recovery Unit 1.83e-06 ***
## ICUTypeMedical ICU 0.00991 **
## ICUTypeSurgical ICU 0.69073
## Weight_max 0.12917
## Albumin_min 0.07010 .
## Bilirubin_max 0.06615 .
## BUN_max 5.16e-08 ***
## Creatinine_max 0.58352
## GCS_max 3.09e-13 ***
## Glucose_min 0.95813
## Glucose_max 0.30199
## HCO3_min 0.02853 *
## HR_min 0.06435 .
## HR_max 0.42651
## K_min 0.50729
## K_max 0.52468
## Lactate_max 0.05144 .
## MAP_min 0.63931
## Na_min 0.79516
## Na_max 0.07630 .
## Platelets_min 0.28945
## PFratio 0.90290
## pH_min 0.01345 *
## pH_max 0.69845
## RespRate_min 0.22420
## RespRate_max 0.23653
## Temp_min 0.39617
## Temp_max 0.01636 *
## TroponinT_max 0.29558
## TroponinI_max 0.47358
## Urine_min 0.07168 .
## WBC_min 0.06344 .
## WBC_max 0.08197 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Age 1.0337 0.9674 1.0277 1.0397
## Length_of_stay 1.0038 0.9962 0.9980 1.0095
## GenderMale 0.9717 1.0292 0.8269 1.1417
## ICUTypeCardiac Surgery Recovery Unit 0.4550 2.1978 0.3293 0.6288
## ICUTypeMedical ICU 1.3568 0.7370 1.0760 1.7109
## ICUTypeSurgical ICU 0.9459 1.0572 0.7192 1.2441
## Weight_max 0.9971 1.0030 0.9933 1.0009
## Albumin_min 0.8865 1.1280 0.7781 1.0099
## Bilirubin_max 1.0148 0.9854 0.9990 1.0308
## BUN_max 1.0111 0.9890 1.0071 1.0151
## Creatinine_max 0.9848 1.0154 0.9325 1.0401
## GCS_max 0.8981 1.1135 0.8725 0.9244
## Glucose_min 1.0001 0.9999 0.9981 1.0020
## Glucose_max 1.0006 0.9994 0.9995 1.0017
## HCO3_min 1.0213 0.9791 1.0022 1.0408
## HR_min 1.0057 0.9943 0.9997 1.0118
## HR_max 1.0016 0.9984 0.9977 1.0056
## K_min 1.0553 0.9476 0.9001 1.2371
## K_max 0.9718 1.0290 0.8898 1.0613
## Lactate_max 1.0407 0.9609 0.9998 1.0834
## MAP_min 0.9989 1.0011 0.9941 1.0036
## Na_min 0.9952 1.0048 0.9597 1.0320
## Na_max 0.9675 1.0335 0.9329 1.0035
## Platelets_min 0.9995 1.0005 0.9987 1.0004
## PFratio 1.0000 1.0000 0.9992 1.0007
## pH_min 0.6110 1.6366 0.4134 0.9031
## pH_max 1.2992 0.7697 0.3457 4.8828
## RespRate_min 0.9842 1.0160 0.9593 1.0098
## RespRate_max 1.0074 0.9926 0.9952 1.0198
## Temp_min 0.9595 1.0423 0.8720 1.0557
## Temp_max 0.8712 1.1479 0.7784 0.9750
## TroponinT_max 1.0192 0.9812 0.9835 1.0562
## TroponinI_max 1.0029 0.9971 0.9950 1.0108
## Urine_min 0.9983 1.0017 0.9964 1.0002
## WBC_min 1.0275 0.9732 0.9985 1.0574
## WBC_max 0.9792 1.0212 0.9563 1.0027
##
## Concordance= 0.745 (se = 0.009 )
## Likelihood ratio test= 521.9 on 36 df, p=<2e-16
## Wald test = 509.5 on 36 df, p=<2e-16
## Score (logrank) test = 559.1 on 36 df, p=<2e-16
# Calculate full model AIC
AIC.mv_full <- calc_aic(ICU.mv_full)
AIC.mv_full
## [1] 10069.33
# 1st reduced model using all variables with significant log-rank tests
ICU.mv_reduced1 <- coxph(Surv(Days, Status) ~
Age + Length_of_stay + ICUType + Weight_max + Albumin_min + Bilirubin_max +
BUN_max + Creatinine_max + Glucose_max + HCO3_min +
K_max + Lactate_max + MAP_min + Na_min + pH_min +
pH_max + RespRate_min + RespRate_max + Temp_min +
Temp_max + TroponinT_max + Urine_min,
data = nm_icu_model_df1)
summary(ICU.mv_reduced1)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + Length_of_stay + ICUType +
## Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## Glucose_max + HCO3_min + K_max + Lactate_max + MAP_min +
## Na_min + pH_min + pH_max + RespRate_min + RespRate_max +
## Temp_min + Temp_max + TroponinT_max + Urine_min, data = nm_icu_model_df1)
##
## n= 1891, number of events= 718
##
## coef exp(coef) se(coef) z
## Age 0.0315028 1.0320043 0.0028612 11.010
## Length_of_stay 0.0067464 1.0067693 0.0027344 2.467
## ICUTypeCardiac Surgery Recovery Unit -0.6525819 0.5206997 0.1522820 -4.285
## ICUTypeMedical ICU 0.3765856 1.4573003 0.1179526 3.193
## ICUTypeSurgical ICU 0.0373253 1.0380307 0.1352985 0.276
## Weight_max -0.0026261 0.9973774 0.0018258 -1.438
## Albumin_min -0.1416610 0.8679154 0.0648103 -2.186
## Bilirubin_max 0.0144937 1.0145993 0.0080846 1.793
## BUN_max 0.0119413 1.0120128 0.0019512 6.120
## Creatinine_max -0.0293659 0.9710611 0.0267635 -1.097
## Glucose_max 0.0002868 1.0002868 0.0004068 0.705
## HCO3_min 0.0200113 1.0202129 0.0091897 2.178
## K_max -0.0264548 0.9738921 0.0363111 -0.729
## Lactate_max 0.0506571 1.0519621 0.0198910 2.547
## MAP_min -0.0015468 0.9984544 0.0024129 -0.641
## Na_min -0.0278389 0.9725450 0.0081134 -3.431
## pH_min -0.6313771 0.5318589 0.1962175 -3.218
## pH_max 0.7890926 2.2013980 0.6397594 1.233
## RespRate_min 0.0159801 1.0161084 0.0116542 1.371
## RespRate_max 0.0118826 1.0119534 0.0056547 2.101
## Temp_min -0.0383889 0.9623386 0.0470342 -0.816
## Temp_max -0.0899794 0.9139500 0.0556178 -1.618
## TroponinT_max 0.0198190 1.0200167 0.0173735 1.141
## Urine_min -0.0022168 0.9977857 0.0009461 -2.343
## Pr(>|z|)
## Age < 2e-16 ***
## Length_of_stay 0.013617 *
## ICUTypeCardiac Surgery Recovery Unit 1.82e-05 ***
## ICUTypeMedical ICU 0.001410 **
## ICUTypeSurgical ICU 0.782645
## Weight_max 0.150352
## Albumin_min 0.028832 *
## Bilirubin_max 0.073010 .
## BUN_max 9.35e-10 ***
## Creatinine_max 0.272538
## Glucose_max 0.480825
## HCO3_min 0.029438 *
## K_max 0.466271
## Lactate_max 0.010874 *
## MAP_min 0.521478
## Na_min 0.000601 ***
## pH_min 0.001292 **
## pH_max 0.217419
## RespRate_min 0.170316
## RespRate_max 0.035609 *
## Temp_min 0.414391
## Temp_max 0.105702
## TroponinT_max 0.253969
## Urine_min 0.019129 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Age 1.0320 0.9690 1.0262 1.0378
## Length_of_stay 1.0068 0.9933 1.0014 1.0122
## ICUTypeCardiac Surgery Recovery Unit 0.5207 1.9205 0.3863 0.7018
## ICUTypeMedical ICU 1.4573 0.6862 1.1565 1.8363
## ICUTypeSurgical ICU 1.0380 0.9634 0.7962 1.3532
## Weight_max 0.9974 1.0026 0.9938 1.0010
## Albumin_min 0.8679 1.1522 0.7644 0.9855
## Bilirubin_max 1.0146 0.9856 0.9986 1.0308
## BUN_max 1.0120 0.9881 1.0082 1.0159
## Creatinine_max 0.9711 1.0298 0.9214 1.0234
## Glucose_max 1.0003 0.9997 0.9995 1.0011
## HCO3_min 1.0202 0.9802 1.0020 1.0388
## K_max 0.9739 1.0268 0.9070 1.0457
## Lactate_max 1.0520 0.9506 1.0117 1.0938
## MAP_min 0.9985 1.0015 0.9937 1.0032
## Na_min 0.9725 1.0282 0.9572 0.9881
## pH_min 0.5319 1.8802 0.3621 0.7813
## pH_max 2.2014 0.4543 0.6283 7.7137
## RespRate_min 1.0161 0.9841 0.9932 1.0396
## RespRate_max 1.0120 0.9882 1.0008 1.0232
## Temp_min 0.9623 1.0391 0.8776 1.0553
## Temp_max 0.9139 1.0942 0.8196 1.0192
## TroponinT_max 1.0200 0.9804 0.9859 1.0553
## Urine_min 0.9978 1.0022 0.9959 0.9996
##
## Concordance= 0.727 (se = 0.009 )
## Likelihood ratio test= 456.3 on 24 df, p=<2e-16
## Wald test = 442.6 on 24 df, p=<2e-16
## Score (logrank) test = 485 on 24 df, p=<2e-16
# Calculate 1st reduced model AIC
AIC.mv_reduced1 <- calc_aic(ICU.mv_reduced1)
AIC.mv_reduced1
## [1] 10110.9
# 2nd reduced model using all variables significant (using cut off p < 0.1) in ICU.mv_reduced1
# (note using p < 0.1 gained better results than p < 0.05 as a cut off)
ICU.mv_reduced2 <- coxph(Surv(Days, Status) ~
Age + Length_of_stay + ICUType + Albumin_min + Bilirubin_max + BUN_max +
HCO3_min + Lactate_max + Na_min + pH_min +
RespRate_max + Urine_min,
data = nm_icu_model_df1)
summary(ICU.mv_reduced2)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + Length_of_stay + ICUType +
## Albumin_min + Bilirubin_max + BUN_max + HCO3_min + Lactate_max +
## Na_min + pH_min + RespRate_max + Urine_min, data = nm_icu_model_df1)
##
## n= 1891, number of events= 718
##
## coef exp(coef) se(coef) z
## Age 0.0342152 1.0348073 0.0027119 12.617
## Length_of_stay 0.0066285 1.0066505 0.0027381 2.421
## ICUTypeCardiac Surgery Recovery Unit -0.7262224 0.4837329 0.1427662 -5.087
## ICUTypeMedical ICU 0.2942195 1.3420785 0.1116344 2.636
## ICUTypeSurgical ICU -0.0459002 0.9551373 0.1292978 -0.355
## Albumin_min -0.1376465 0.8714067 0.0638600 -2.155
## Bilirubin_max 0.0147620 1.0148715 0.0079243 1.863
## BUN_max 0.0103013 1.0103545 0.0014129 7.291
## HCO3_min 0.0189487 1.0191293 0.0087368 2.169
## Lactate_max 0.0596891 1.0615065 0.0184686 3.232
## Na_min -0.0254179 0.9749024 0.0073586 -3.454
## pH_min -0.6575889 0.5180990 0.1931090 -3.405
## RespRate_max 0.0134154 1.0135057 0.0047816 2.806
## Urine_min -0.0022186 0.9977839 0.0009321 -2.380
## Pr(>|z|)
## Age < 2e-16 ***
## Length_of_stay 0.015486 *
## ICUTypeCardiac Surgery Recovery Unit 3.64e-07 ***
## ICUTypeMedical ICU 0.008400 **
## ICUTypeSurgical ICU 0.722593
## Albumin_min 0.031127 *
## Bilirubin_max 0.062479 .
## BUN_max 3.08e-13 ***
## HCO3_min 0.030095 *
## Lactate_max 0.001230 **
## Na_min 0.000552 ***
## pH_min 0.000661 ***
## RespRate_max 0.005022 **
## Urine_min 0.017300 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Age 1.0348 0.9664 1.0293 1.0403
## Length_of_stay 1.0067 0.9934 1.0013 1.0121
## ICUTypeCardiac Surgery Recovery Unit 0.4837 2.0673 0.3657 0.6399
## ICUTypeMedical ICU 1.3421 0.7451 1.0783 1.6703
## ICUTypeSurgical ICU 0.9551 1.0470 0.7413 1.2306
## Albumin_min 0.8714 1.1476 0.7689 0.9876
## Bilirubin_max 1.0149 0.9853 0.9992 1.0308
## BUN_max 1.0104 0.9898 1.0076 1.0132
## HCO3_min 1.0191 0.9812 1.0018 1.0367
## Lactate_max 1.0615 0.9421 1.0238 1.1006
## Na_min 0.9749 1.0257 0.9609 0.9891
## pH_min 0.5181 1.9301 0.3548 0.7565
## RespRate_max 1.0135 0.9867 1.0041 1.0230
## Urine_min 0.9978 1.0022 0.9960 0.9996
##
## Concordance= 0.725 (se = 0.009 )
## Likelihood ratio test= 442 on 14 df, p=<2e-16
## Wald test = 424.5 on 14 df, p=<2e-16
## Score (logrank) test = 458.8 on 14 df, p=<2e-16
# Calculate 2nd reduced model AIC
AIC.mv_reduced2 <- calc_aic(ICU.mv_reduced2)
AIC.mv_reduced2
## [1] 10105.2
# 3rd reduced model by using step() function on the full model (which had the lowest AIC so far)
ICU.mv_reduced3 <- step(ICU.mv_full, trace=1)
## Start: AIC=10069.33
## Surv(Days, Status) ~ Age + Length_of_stay + Gender + ICUType +
## Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min +
## HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min +
## Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min +
## RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max +
## Urine_min + WBC_min + WBC_max
##
## Df AIC
## - Glucose_min 1 10067
## - PFratio 1 10067
## - Na_min 1 10067
## - Gender 1 10068
## - pH_max 1 10068
## - MAP_min 1 10068
## - Creatinine_max 1 10068
## - K_max 1 10068
## - K_min 1 10068
## - TroponinI_max 1 10068
## - HR_max 1 10068
## - Temp_min 1 10068
## - Glucose_max 1 10068
## - TroponinT_max 1 10068
## - Platelets_min 1 10068
## - RespRate_max 1 10069
## - RespRate_min 1 10069
## - Length_of_stay 1 10069
## <none> 10069
## - Weight_max 1 10070
## - Bilirubin_max 1 10070
## - WBC_max 1 10070
## - Na_max 1 10071
## - Albumin_min 1 10071
## - HR_min 1 10071
## - WBC_min 1 10071
## - Lactate_max 1 10071
## - Urine_min 1 10071
## - pH_min 1 10071
## - HCO3_min 1 10072
## - Temp_max 1 10073
## - BUN_max 1 10095
## - GCS_max 1 10118
## - ICUType 3 10125
## - Age 1 10208
##
## Step: AIC=10067.33
## Surv(Days, Status) ~ Age + Length_of_stay + Gender + ICUType +
## Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + K_min +
## K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min +
## PFratio + pH_min + pH_max + RespRate_min + RespRate_max +
## Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min +
## WBC_min + WBC_max
##
## Df AIC
## - PFratio 1 10065
## - Na_min 1 10065
## - Gender 1 10066
## - pH_max 1 10066
## - MAP_min 1 10066
## - Creatinine_max 1 10066
## - K_max 1 10066
## - K_min 1 10066
## - TroponinI_max 1 10066
## - HR_max 1 10066
## - Temp_min 1 10066
## - TroponinT_max 1 10066
## - Platelets_min 1 10066
## - RespRate_max 1 10067
## - RespRate_min 1 10067
## - Glucose_max 1 10067
## - Length_of_stay 1 10067
## <none> 10067
## - Weight_max 1 10068
## - Bilirubin_max 1 10068
## - WBC_max 1 10068
## - Albumin_min 1 10069
## - HR_min 1 10069
## - Na_max 1 10069
## - WBC_min 1 10069
## - Lactate_max 1 10069
## - Urine_min 1 10069
## - pH_min 1 10069
## - HCO3_min 1 10070
## - Temp_max 1 10071
## - BUN_max 1 10093
## - GCS_max 1 10116
## - ICUType 3 10123
## - Age 1 10206
##
## Step: AIC=10065.35
## Surv(Days, Status) ~ Age + Length_of_stay + Gender + ICUType +
## Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + K_min +
## K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min +
## pH_min + pH_max + RespRate_min + RespRate_max + Temp_min +
## Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min +
## WBC_max
##
## Df AIC
## - Na_min 1 10063
## - Gender 1 10064
## - pH_max 1 10064
## - MAP_min 1 10064
## - Creatinine_max 1 10064
## - K_max 1 10064
## - K_min 1 10064
## - TroponinI_max 1 10064
## - HR_max 1 10064
## - Temp_min 1 10064
## - TroponinT_max 1 10064
## - Platelets_min 1 10064
## - RespRate_max 1 10065
## - RespRate_min 1 10065
## - Glucose_max 1 10065
## - Length_of_stay 1 10065
## <none> 10065
## - Weight_max 1 10066
## - Bilirubin_max 1 10066
## - WBC_max 1 10066
## - Albumin_min 1 10067
## - HR_min 1 10067
## - WBC_min 1 10067
## - Na_max 1 10067
## - Urine_min 1 10067
## - Lactate_max 1 10067
## - pH_min 1 10068
## - HCO3_min 1 10068
## - Temp_max 1 10069
## - BUN_max 1 10091
## - GCS_max 1 10115
## - ICUType 3 10121
## - Age 1 10205
##
## Step: AIC=10063.41
## Surv(Days, Status) ~ Age + Length_of_stay + Gender + ICUType +
## Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + K_min +
## K_max + Lactate_max + MAP_min + Na_max + Platelets_min +
## pH_min + pH_max + RespRate_min + RespRate_max + Temp_min +
## Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min +
## WBC_max
##
## Df AIC
## - Gender 1 10062
## - pH_max 1 10062
## - MAP_min 1 10062
## - Creatinine_max 1 10062
## - K_max 1 10062
## - K_min 1 10062
## - HR_max 1 10062
## - TroponinI_max 1 10062
## - Temp_min 1 10062
## - TroponinT_max 1 10062
## - Platelets_min 1 10062
## - RespRate_max 1 10063
## - RespRate_min 1 10063
## - Length_of_stay 1 10063
## - Glucose_max 1 10063
## <none> 10063
## - Weight_max 1 10064
## - WBC_max 1 10064
## - Bilirubin_max 1 10065
## - Albumin_min 1 10065
## - WBC_min 1 10065
## - HR_min 1 10065
## - Urine_min 1 10065
## - Lactate_max 1 10065
## - pH_min 1 10066
## - HCO3_min 1 10066
## - Temp_max 1 10067
## - Na_max 1 10082
## - BUN_max 1 10089
## - GCS_max 1 10113
## - ICUType 3 10120
## - Age 1 10203
##
## Step: AIC=10061.52
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + K_min +
## K_max + Lactate_max + MAP_min + Na_max + Platelets_min +
## pH_min + pH_max + RespRate_min + RespRate_max + Temp_min +
## Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min +
## WBC_max
##
## Df AIC
## - pH_max 1 10060
## - MAP_min 1 10060
## - Creatinine_max 1 10060
## - K_max 1 10060
## - K_min 1 10060
## - HR_max 1 10060
## - TroponinI_max 1 10060
## - Temp_min 1 10060
## - TroponinT_max 1 10060
## - Platelets_min 1 10061
## - RespRate_max 1 10061
## - RespRate_min 1 10061
## - Length_of_stay 1 10061
## - Glucose_max 1 10062
## <none> 10062
## - Weight_max 1 10062
## - WBC_max 1 10063
## - Bilirubin_max 1 10063
## - Albumin_min 1 10063
## - WBC_min 1 10063
## - HR_min 1 10063
## - Lactate_max 1 10063
## - Urine_min 1 10063
## - pH_min 1 10064
## - HCO3_min 1 10064
## - Temp_max 1 10065
## - Na_max 1 10080
## - BUN_max 1 10087
## - GCS_max 1 10111
## - ICUType 3 10118
## - Age 1 10202
##
## Step: AIC=10059.67
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + K_min +
## K_max + Lactate_max + MAP_min + Na_max + Platelets_min +
## pH_min + RespRate_min + RespRate_max + Temp_min + Temp_max +
## TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
##
## Df AIC
## - MAP_min 1 10058
## - K_min 1 10058
## - Creatinine_max 1 10058
## - K_max 1 10058
## - HR_max 1 10058
## - TroponinI_max 1 10058
## - Temp_min 1 10058
## - TroponinT_max 1 10059
## - Platelets_min 1 10059
## - RespRate_max 1 10059
## - RespRate_min 1 10059
## - Length_of_stay 1 10059
## - Glucose_max 1 10060
## <none> 10060
## - Weight_max 1 10061
## - WBC_max 1 10061
## - Bilirubin_max 1 10061
## - Albumin_min 1 10061
## - WBC_min 1 10061
## - HR_min 1 10061
## - Urine_min 1 10062
## - Lactate_max 1 10062
## - pH_min 1 10062
## - HCO3_min 1 10063
## - Temp_max 1 10064
## - Na_max 1 10079
## - BUN_max 1 10085
## - GCS_max 1 10111
## - ICUType 3 10120
## - Age 1 10200
##
## Step: AIC=10057.95
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + K_min +
## K_max + Lactate_max + Na_max + Platelets_min + pH_min + RespRate_min +
## RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max +
## Urine_min + WBC_min + WBC_max
##
## Df AIC
## - K_min 1 10056
## - K_max 1 10056
## - Creatinine_max 1 10056
## - TroponinI_max 1 10057
## - HR_max 1 10057
## - Temp_min 1 10057
## - TroponinT_max 1 10057
## - Platelets_min 1 10057
## - RespRate_max 1 10057
## - RespRate_min 1 10058
## - Length_of_stay 1 10058
## - Glucose_max 1 10058
## <none> 10058
## - Weight_max 1 10059
## - Bilirubin_max 1 10059
## - WBC_max 1 10059
## - Albumin_min 1 10059
## - WBC_min 1 10059
## - HR_min 1 10059
## - Lactate_max 1 10060
## - Urine_min 1 10060
## - pH_min 1 10060
## - HCO3_min 1 10061
## - Temp_max 1 10062
## - Na_max 1 10078
## - BUN_max 1 10084
## - GCS_max 1 10110
## - ICUType 3 10118
## - Age 1 10201
##
## Step: AIC=10056.24
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + K_max +
## Lactate_max + Na_max + Platelets_min + pH_min + RespRate_min +
## RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max +
## Urine_min + WBC_min + WBC_max
##
## Df AIC
## - K_max 1 10054
## - Creatinine_max 1 10055
## - TroponinI_max 1 10055
## - HR_max 1 10055
## - Temp_min 1 10055
## - Platelets_min 1 10055
## - TroponinT_max 1 10055
## - RespRate_max 1 10056
## - Length_of_stay 1 10056
## - RespRate_min 1 10056
## - Glucose_max 1 10056
## <none> 10056
## - Weight_max 1 10057
## - Bilirubin_max 1 10057
## - WBC_max 1 10058
## - Albumin_min 1 10058
## - HR_min 1 10058
## - WBC_min 1 10058
## - Lactate_max 1 10058
## - Urine_min 1 10058
## - pH_min 1 10059
## - HCO3_min 1 10060
## - Temp_max 1 10060
## - Na_max 1 10077
## - BUN_max 1 10083
## - GCS_max 1 10109
## - ICUType 3 10119
## - Age 1 10200
##
## Step: AIC=10054.43
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + Creatinine_max +
## GCS_max + Glucose_max + HCO3_min + HR_min + HR_max + Lactate_max +
## Na_max + Platelets_min + pH_min + RespRate_min + RespRate_max +
## Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min +
## WBC_min + WBC_max
##
## Df AIC
## - Creatinine_max 1 10053
## - TroponinI_max 1 10053
## - HR_max 1 10053
## - Temp_min 1 10053
## - TroponinT_max 1 10054
## - Platelets_min 1 10054
## - RespRate_max 1 10054
## - Glucose_max 1 10054
## - Length_of_stay 1 10054
## - RespRate_min 1 10054
## <none> 10054
## - Weight_max 1 10055
## - Bilirubin_max 1 10055
## - Albumin_min 1 10056
## - WBC_max 1 10056
## - HR_min 1 10056
## - WBC_min 1 10056
## - Lactate_max 1 10056
## - Urine_min 1 10056
## - pH_min 1 10057
## - HCO3_min 1 10058
## - Temp_max 1 10058
## - Na_max 1 10075
## - BUN_max 1 10082
## - GCS_max 1 10107
## - ICUType 3 10118
## - Age 1 10199
##
## Step: AIC=10052.8
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max +
## HCO3_min + HR_min + HR_max + Lactate_max + Na_max + Platelets_min +
## pH_min + RespRate_min + RespRate_max + Temp_min + Temp_max +
## TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
##
## Df AIC
## - TroponinI_max 1 10051
## - Temp_min 1 10052
## - HR_max 1 10052
## - TroponinT_max 1 10052
## - Platelets_min 1 10052
## - RespRate_max 1 10052
## - Glucose_max 1 10052
## - Length_of_stay 1 10052
## - RespRate_min 1 10053
## <none> 10053
## - Weight_max 1 10054
## - Bilirubin_max 1 10054
## - Albumin_min 1 10054
## - HR_min 1 10054
## - WBC_max 1 10054
## - Urine_min 1 10054
## - Lactate_max 1 10054
## - WBC_min 1 10055
## - pH_min 1 10055
## - HCO3_min 1 10057
## - Temp_max 1 10057
## - Na_max 1 10073
## - BUN_max 1 10092
## - GCS_max 1 10106
## - ICUType 3 10116
## - Age 1 10203
##
## Step: AIC=10051.35
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max +
## HCO3_min + HR_min + HR_max + Lactate_max + Na_max + Platelets_min +
## pH_min + RespRate_min + RespRate_max + Temp_min + Temp_max +
## TroponinT_max + Urine_min + WBC_min + WBC_max
##
## Df AIC
## - Temp_min 1 10050
## - Platelets_min 1 10050
## - HR_max 1 10050
## - TroponinT_max 1 10051
## - Length_of_stay 1 10051
## - RespRate_min 1 10051
## <none> 10051
## - Glucose_max 1 10052
## - RespRate_max 1 10052
## - Bilirubin_max 1 10052
## - Weight_max 1 10052
## - HR_min 1 10052
## - Albumin_min 1 10053
## - Lactate_max 1 10053
## - WBC_max 1 10053
## - Urine_min 1 10053
## - WBC_min 1 10053
## - pH_min 1 10054
## - Temp_max 1 10055
## - HCO3_min 1 10056
## - Na_max 1 10072
## - BUN_max 1 10096
## - GCS_max 1 10104
## - ICUType 3 10115
## - Age 1 10201
##
## Step: AIC=10050.15
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max +
## HCO3_min + HR_min + HR_max + Lactate_max + Na_max + Platelets_min +
## pH_min + RespRate_min + RespRate_max + Temp_max + TroponinT_max +
## Urine_min + WBC_min + WBC_max
##
## Df AIC
## - HR_max 1 10049
## - Platelets_min 1 10049
## - TroponinT_max 1 10050
## - Length_of_stay 1 10050
## - RespRate_min 1 10050
## <none> 10050
## - RespRate_max 1 10050
## - Glucose_max 1 10050
## - HR_min 1 10051
## - Bilirubin_max 1 10051
## - WBC_max 1 10051
## - Weight_max 1 10051
## - WBC_min 1 10052
## - Albumin_min 1 10052
## - Urine_min 1 10052
## - Lactate_max 1 10052
## - pH_min 1 10053
## - HCO3_min 1 10054
## - Temp_max 1 10056
## - Na_max 1 10071
## - BUN_max 1 10094
## - GCS_max 1 10104
## - ICUType 3 10113
## - Age 1 10199
##
## Step: AIC=10049.21
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max +
## HCO3_min + HR_min + Lactate_max + Na_max + Platelets_min +
## pH_min + RespRate_min + RespRate_max + Temp_max + TroponinT_max +
## Urine_min + WBC_min + WBC_max
##
## Df AIC
## - Platelets_min 1 10048
## - TroponinT_max 1 10048
## - RespRate_min 1 10049
## - Length_of_stay 1 10049
## <none> 10049
## - Glucose_max 1 10049
## - RespRate_max 1 10050
## - Bilirubin_max 1 10050
## - WBC_max 1 10050
## - WBC_min 1 10050
## - Albumin_min 1 10051
## - Weight_max 1 10051
## - Urine_min 1 10051
## - Lactate_max 1 10052
## - pH_min 1 10052
## - HR_min 1 10053
## - HCO3_min 1 10053
## - Temp_max 1 10055
## - Na_max 1 10069
## - BUN_max 1 10093
## - GCS_max 1 10103
## - ICUType 3 10114
## - Age 1 10198
##
## Step: AIC=10048.26
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max +
## HCO3_min + HR_min + Lactate_max + Na_max + pH_min + RespRate_min +
## RespRate_max + Temp_max + TroponinT_max + Urine_min + WBC_min +
## WBC_max
##
## Df AIC
## - TroponinT_max 1 10047
## - Length_of_stay 1 10048
## - RespRate_min 1 10048
## <none> 10048
## - Glucose_max 1 10048
## - RespRate_max 1 10048
## - WBC_min 1 10049
## - WBC_max 1 10049
## - Bilirubin_max 1 10050
## - Weight_max 1 10050
## - Albumin_min 1 10050
## - Urine_min 1 10050
## - pH_min 1 10051
## - Lactate_max 1 10051
## - HR_min 1 10052
## - HCO3_min 1 10052
## - Temp_max 1 10054
## - Na_max 1 10068
## - BUN_max 1 10092
## - GCS_max 1 10103
## - ICUType 3 10113
## - Age 1 10199
##
## Step: AIC=10047.33
## Surv(Days, Status) ~ Age + Length_of_stay + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max +
## HCO3_min + HR_min + Lactate_max + Na_max + pH_min + RespRate_min +
## RespRate_max + Temp_max + Urine_min + WBC_min + WBC_max
##
## Df AIC
## - Length_of_stay 1 10047
## <none> 10047
## - RespRate_min 1 10047
## - Glucose_max 1 10048
## - RespRate_max 1 10048
## - WBC_max 1 10049
## - WBC_min 1 10049
## - Weight_max 1 10049
## - Bilirubin_max 1 10049
## - Albumin_min 1 10049
## - Urine_min 1 10050
## - HR_min 1 10050
## - HCO3_min 1 10051
## - pH_min 1 10051
## - Lactate_max 1 10051
## - Temp_max 1 10053
## - Na_max 1 10067
## - BUN_max 1 10090
## - GCS_max 1 10102
## - ICUType 3 10112
## - Age 1 10197
##
## Step: AIC=10047.03
## Surv(Days, Status) ~ Age + ICUType + Weight_max + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + Glucose_max + HCO3_min +
## HR_min + Lactate_max + Na_max + pH_min + RespRate_min + RespRate_max +
## Temp_max + Urine_min + WBC_min + WBC_max
##
## Df AIC
## <none> 10047
## - Glucose_max 1 10047
## - RespRate_min 1 10047
## - RespRate_max 1 10048
## - WBC_min 1 10048
## - WBC_max 1 10048
## - Weight_max 1 10048
## - Bilirubin_max 1 10049
## - Albumin_min 1 10050
## - Urine_min 1 10050
## - HCO3_min 1 10050
## - HR_min 1 10050
## - pH_min 1 10051
## - Lactate_max 1 10052
## - Temp_max 1 10052
## - Na_max 1 10067
## - BUN_max 1 10093
## - GCS_max 1 10106
## - ICUType 3 10113
## - Age 1 10196
summary(ICU.mv_reduced3)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + ICUType + Weight_max +
## Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max +
## HCO3_min + HR_min + Lactate_max + Na_max + pH_min + RespRate_min +
## RespRate_max + Temp_max + Urine_min + WBC_min + WBC_max,
## data = nm_icu_model_df1)
##
## n= 1891, number of events= 718
##
## coef exp(coef) se(coef) z
## Age 0.0335059 1.0340735 0.0028842 11.617
## ICUTypeCardiac Surgery Recovery Unit -0.7414854 0.4764057 0.1478489 -5.015
## ICUTypeMedical ICU 0.2731180 1.3140552 0.1123699 2.431
## ICUTypeSurgical ICU -0.0488882 0.9522876 0.1294356 -0.378
## Weight_max -0.0032325 0.9967727 0.0018189 -1.777
## Albumin_min -0.1366303 0.8722926 0.0649906 -2.102
## Bilirubin_max 0.0159617 1.0160898 0.0078115 2.043
## BUN_max 0.0106978 1.0107552 0.0014312 7.475
## GCS_max -0.1113793 0.8945993 0.0139355 -7.992
## Glucose_max 0.0006055 1.0006057 0.0004068 1.488
## HCO3_min 0.0204247 1.0206347 0.0090036 2.268
## HR_min 0.0061319 1.0061508 0.0026181 2.342
## Lactate_max 0.0501780 1.0514583 0.0191317 2.623
## Na_max -0.0371886 0.9634944 0.0079158 -4.698
## pH_min -0.5373745 0.5842802 0.1812453 -2.965
## RespRate_min -0.0191478 0.9810343 0.0128515 -1.490
## RespRate_max 0.0094413 1.0094860 0.0056348 1.676
## Temp_max -0.1426076 0.8670942 0.0527817 -2.702
## Urine_min -0.0019346 0.9980673 0.0009480 -2.041
## WBC_min 0.0243720 1.0246714 0.0137477 1.773
## WBC_max -0.0202435 0.9799600 0.0115055 -1.759
## Pr(>|z|)
## Age < 2e-16 ***
## ICUTypeCardiac Surgery Recovery Unit 5.30e-07 ***
## ICUTypeMedical ICU 0.01508 *
## ICUTypeSurgical ICU 0.70565
## Weight_max 0.07555 .
## Albumin_min 0.03553 *
## Bilirubin_max 0.04102 *
## BUN_max 7.73e-14 ***
## GCS_max 1.32e-15 ***
## Glucose_max 0.13667
## HCO3_min 0.02330 *
## HR_min 0.01918 *
## Lactate_max 0.00872 **
## Na_max 2.63e-06 ***
## pH_min 0.00303 **
## RespRate_min 0.13624
## RespRate_max 0.09383 .
## Temp_max 0.00690 **
## Urine_min 0.04129 *
## WBC_min 0.07626 .
## WBC_max 0.07850 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Age 1.0341 0.9670 1.0282 1.0399
## ICUTypeCardiac Surgery Recovery Unit 0.4764 2.0991 0.3566 0.6365
## ICUTypeMedical ICU 1.3141 0.7610 1.0543 1.6378
## ICUTypeSurgical ICU 0.9523 1.0501 0.7389 1.2273
## Weight_max 0.9968 1.0032 0.9932 1.0003
## Albumin_min 0.8723 1.1464 0.7680 0.9908
## Bilirubin_max 1.0161 0.9842 1.0007 1.0318
## BUN_max 1.0108 0.9894 1.0079 1.0136
## GCS_max 0.8946 1.1178 0.8705 0.9194
## Glucose_max 1.0006 0.9994 0.9998 1.0014
## HCO3_min 1.0206 0.9798 1.0028 1.0388
## HR_min 1.0062 0.9939 1.0010 1.0113
## Lactate_max 1.0515 0.9511 1.0128 1.0916
## Na_max 0.9635 1.0379 0.9487 0.9786
## pH_min 0.5843 1.7115 0.4096 0.8335
## RespRate_min 0.9810 1.0193 0.9566 1.0061
## RespRate_max 1.0095 0.9906 0.9984 1.0207
## Temp_max 0.8671 1.1533 0.7819 0.9616
## Urine_min 0.9981 1.0019 0.9962 0.9999
## WBC_min 1.0247 0.9759 0.9974 1.0527
## WBC_max 0.9800 1.0204 0.9581 1.0023
##
## Concordance= 0.742 (se = 0.009 )
## Likelihood ratio test= 514.2 on 21 df, p=<2e-16
## Wald test = 501.4 on 21 df, p=<2e-16
## Score (logrank) test = 544.9 on 21 df, p=<2e-16
## Interestingly: GCS_max, HR_min & Na_max have worked their way back in (not significant on log-rank)
# Calculate 3rd reduced model AIC
AIC.mv_reduced3 <- calc_aic(ICU.mv_reduced3)
AIC.mv_reduced3
## [1] 10047.03
# 4th reduced model using significant variables (using cut off p < 0.05) from ICU.mv_reduced3
ICU.mv_reduced4 <- coxph(Surv(Days, Status) ~
Age + ICUType + Albumin_min + Bilirubin_max + BUN_max +
GCS_max + HCO3_min + HR_min + Lactate_max + Na_max +
pH_min + Temp_max + Urine_min,
data = nm_icu_model_df1)
summary(ICU.mv_reduced4)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + ICUType + Albumin_min +
## Bilirubin_max + BUN_max + GCS_max + HCO3_min + HR_min + Lactate_max +
## Na_max + pH_min + Temp_max + Urine_min, data = nm_icu_model_df1)
##
## n= 1891, number of events= 718
##
## coef exp(coef) se(coef) z
## Age 0.0349987 1.0356184 0.0027738 12.618
## ICUTypeCardiac Surgery Recovery Unit -0.7711169 0.4624962 0.1437321 -5.365
## ICUTypeMedical ICU 0.2943134 1.3422045 0.1114656 2.640
## ICUTypeSurgical ICU -0.0566363 0.9449377 0.1280090 -0.442
## Albumin_min -0.1011402 0.9038063 0.0639816 -1.581
## Bilirubin_max 0.0181514 1.0183172 0.0075868 2.392
## BUN_max 0.0102522 1.0103050 0.0013938 7.356
## GCS_max -0.1058402 0.8995684 0.0123712 -8.555
## HCO3_min 0.0179127 1.0180741 0.0086291 2.076
## HR_min 0.0063654 1.0063857 0.0025240 2.522
## Lactate_max 0.0546456 1.0561662 0.0186056 2.937
## Na_max -0.0372099 0.9634739 0.0078669 -4.730
## pH_min -0.4748423 0.6219831 0.1876353 -2.531
## Temp_max -0.1557282 0.8557918 0.0518565 -3.003
## Urine_min -0.0018282 0.9981735 0.0009317 -1.962
## Pr(>|z|)
## Age < 2e-16 ***
## ICUTypeCardiac Surgery Recovery Unit 8.10e-08 ***
## ICUTypeMedical ICU 0.00828 **
## ICUTypeSurgical ICU 0.65817
## Albumin_min 0.11393
## Bilirubin_max 0.01673 *
## BUN_max 1.90e-13 ***
## GCS_max < 2e-16 ***
## HCO3_min 0.03791 *
## HR_min 0.01167 *
## Lactate_max 0.00331 **
## Na_max 2.25e-06 ***
## pH_min 0.01138 *
## Temp_max 0.00267 **
## Urine_min 0.04974 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Age 1.0356 0.9656 1.0300 1.0413
## ICUTypeCardiac Surgery Recovery Unit 0.4625 2.1622 0.3490 0.6130
## ICUTypeMedical ICU 1.3422 0.7450 1.0788 1.6699
## ICUTypeSurgical ICU 0.9449 1.0583 0.7353 1.2144
## Albumin_min 0.9038 1.1064 0.7973 1.0246
## Bilirubin_max 1.0183 0.9820 1.0033 1.0336
## BUN_max 1.0103 0.9898 1.0075 1.0131
## GCS_max 0.8996 1.1116 0.8780 0.9216
## HCO3_min 1.0181 0.9822 1.0010 1.0354
## HR_min 1.0064 0.9937 1.0014 1.0114
## Lactate_max 1.0562 0.9468 1.0183 1.0954
## Na_max 0.9635 1.0379 0.9487 0.9784
## pH_min 0.6220 1.6078 0.4306 0.8985
## Temp_max 0.8558 1.1685 0.7731 0.9473
## Urine_min 0.9982 1.0018 0.9964 1.0000
##
## Concordance= 0.738 (se = 0.009 )
## Likelihood ratio test= 501.7 on 15 df, p=<2e-16
## Wald test = 482.1 on 15 df, p=<2e-16
## Score (logrank) test = 520.6 on 15 df, p=<2e-16
# Calculate 4th reduced model AIC
AIC.mv_reduced4 <- calc_aic(ICU.mv_reduced4)
AIC.mv_reduced4
## [1] 10047.51
# Comparing models with LRT
lapply(list(ICU.mv_reduced1, ICU.mv_reduced2, ICU.mv_reduced3, ICU.mv_reduced4),
function(reduced) {print(anova(ICU.mv_full, reduced))} )
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + Length_of_stay + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + Glucose_max + HCO3_min + K_max + Lactate_max + MAP_min + Na_min + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + Urine_min
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5031.4 65.57 12 2.139e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + Length_of_stay + ICUType + Albumin_min + Bilirubin_max + BUN_max + HCO3_min + Lactate_max + Na_min + pH_min + RespRate_max + Urine_min
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5038.6 79.871 22 1.701e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max + HCO3_min + HR_min + Lactate_max + Na_max + pH_min + RespRate_min + RespRate_max + Temp_max + Urine_min + WBC_min + WBC_max
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5002.5 7.6969 15 0.9354
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + ICUType + Albumin_min + Bilirubin_max + BUN_max + GCS_max + HCO3_min + HR_min + Lactate_max + Na_max + pH_min + Temp_max + Urine_min
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5008.8 20.175 21 0.5102
## [[1]]
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + Length_of_stay + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + Glucose_max + HCO3_min + K_max + Lactate_max + MAP_min + Na_min + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + Urine_min
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5031.4 65.57 12 2.139e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## [[2]]
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + Length_of_stay + ICUType + Albumin_min + Bilirubin_max + BUN_max + HCO3_min + Lactate_max + Na_min + pH_min + RespRate_max + Urine_min
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5038.6 79.871 22 1.701e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## [[3]]
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max + HCO3_min + HR_min + Lactate_max + Na_max + pH_min + RespRate_min + RespRate_max + Temp_max + Urine_min + WBC_min + WBC_max
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5002.5 7.6969 15 0.9354
##
## [[4]]
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + Length_of_stay + Gender + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + Creatinine_max + GCS_max + Glucose_min + Glucose_max + HCO3_min + HR_min + HR_max + K_min + K_max + Lactate_max + MAP_min + Na_min + Na_max + Platelets_min + PFratio + pH_min + pH_max + RespRate_min + RespRate_max + Temp_min + Temp_max + TroponinT_max + TroponinI_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + ICUType + Albumin_min + Bilirubin_max + BUN_max + GCS_max + HCO3_min + HR_min + Lactate_max + Na_max + pH_min + Temp_max + Urine_min
## loglik Chisq Df P(>|Chi|)
## 1 -4998.7
## 2 -5008.8 20.175 21 0.5102
## Results: reduced1 and reduced2 - reject the null hypothesis that the reduced models are better (they are worse)
## reduced3 and reduced4 - DONT reject the null hypothesis
## --> therefore the reduced models are better than the full model (matches our AICs)
# Print the AICs all together to review
aic_output <- c(AIC.mv_full, AIC.mv_reduced1, AIC.mv_reduced2, AIC.mv_reduced3, AIC.mv_reduced4)
names(aic_output) <- c('Full AIC:', 'Reduced 1 AIC:', 'Reduced 2 AIC:', 'Reduced 3 AIC:', 'Reduced 4 AIC:')
print(aic_output)
## Full AIC: Reduced 1 AIC: Reduced 2 AIC: Reduced 3 AIC: Reduced 4 AIC:
## 10069.33 10110.90 10105.20 10047.03 10047.51
## Decision: use ICU.mv_reduced4 as the provisional final model (lowest AIC and non-significant LRT)
# Compare LRT for 3rd and 4th reduced models
anova(ICU.mv_reduced3, ICU.mv_reduced4)
## Analysis of Deviance Table
## Cox model: response is Surv(Days, Status)
## Model 1: ~ Age + ICUType + Weight_max + Albumin_min + Bilirubin_max + BUN_max + GCS_max + Glucose_max + HCO3_min + HR_min + Lactate_max + Na_max + pH_min + RespRate_min + RespRate_max + Temp_max + Urine_min + WBC_min + WBC_max
## Model 2: ~ Age + ICUType + Albumin_min + Bilirubin_max + BUN_max + GCS_max + HCO3_min + HR_min + Lactate_max + Na_max + pH_min + Temp_max + Urine_min
## loglik Chisq Df P(>|Chi|)
## 1 -5002.5
## 2 -5008.8 12.478 6 0.05212 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Selecting a multivariable Cox proportional hazards model:
Full model - a model with all selected variables (excluding those with high degree of missingness) has been fitted. In the resulting fitted model, Age, ICU type, BUN_max, GCS_max, are highly significant. Lactate_max, pH_min, Temp_max and urine_min are also significant at 5% significance level. Furthermore, Albumin_min, Bilirubin_max, HCO3_min, HR_min, WBC_min and WBC_max are significant at 10% significance level. The resulting model has a maximised likelihood of 521.9. The log rank test statistic is highly significant (p-value close to 0), indicating that the variables in the full model have significant explanatory power on ICU population survival. Note, the AIC of the full model is 10,069.
Reduced Model 1 - for parsimony, we look for a reduced model with fewer variables than can adequately explain survival rates for the ICU population. Our first attempt is to only include variables that resulted in a significant log rank test for the respective univariate models. Since the reduced model is nested in the full model, we use a likelihood ratio test to compare the two model. We reject the null hypothesis (p-value is 2.139e-09) and conclude that the full model is a better fit to the data. This conclusion is echoed when comparing the models’ AICs - the reduced model has a higher AIC of 10,111.
Reduced Model 2 - the second attempt, reduces the Reduced Model 1 by only including variables that were significant at a 10% significance level. We can again use a likelihood ratio test to compare this model with the full model as the models are nested. We reject the null hypothesis (p-value is 1.701e-08) and conclude that the full model is a better fit to the data. Whilst the AIC for Model 2 (10,105) is lower than for Model 1, it is higher than the Full Model, which leads to the same conclusion as the LRT test.
Reduced Model 3 - the third attempt starts with the full model and uses the step function to search the model space for a model with a better fit and fewer covariates. After 17 iterations, the reduced model includes 18 covariates. Interestingly, GCS_max, HR_min & Na_max are now being included in the model despite the non-significant log rank tests for the univariate models. When compared with the full model, the null hypothesis of the LRT test (p-value = 0.94)is accepted and we can conclude that the reduced model is a better fit to the data than the full model. Furthermore, the AIC is reduced to 10,047.
Reduced Model 4 - in this model, we take Model 3 and only include the significant variables at 5% significance level (i.e. removed Weight_max, RespRate_min, respRate_max, WBC_min, WBC_max). When compared with the full model, the null hypothesis of the LRT test (p-value = 0.51) is accepted and we can conclude that the reduced model is a better fit to the data than the full model. Furthermore, the AIC is 10,047 similar to the AIC for Reduced Model 3. The LRT when comparing Model 3 and 4 does not reject the null hypothesis concluding that Model 4 is a better fit than Model 3.
Hence, we choose Model 4 as the final selection of covariates for the multivariable Cox model.
## Testing assumptions ##
# Testing for proportional hazards assumption of ICU.mv_reduced4 using cox.zph()
cox.zph(ICU.mv_reduced4, terms=FALSE)
## chisq df p
## Age 1.35899 1 0.24371
## ICUTypeCardiac Surgery Recovery Unit 9.89227 1 0.00166
## ICUTypeMedical ICU 0.00566 1 0.94003
## ICUTypeSurgical ICU 4.97590 1 0.02570
## Albumin_min 13.14763 1 0.00029
## Bilirubin_max 12.11575 1 0.00050
## BUN_max 1.05751 1 0.30378
## GCS_max 24.42255 1 7.7e-07
## HCO3_min 24.92796 1 6.0e-07
## HR_min 4.47176 1 0.03446
## Lactate_max 32.57957 1 1.1e-08
## Na_max 0.08735 1 0.76758
## pH_min 0.45681 1 0.49912
## Temp_max 1.37742 1 0.24054
## Urine_min 3.24942 1 0.07145
## GLOBAL 88.87711 15 1.6e-12
## Result: statistically significant global test, therefore the proportional hazards model is violated
## (the variables that violate are: ICUType, Albumin_min, Bilirubin_max, GCS_max, HCO3_min, HR_min, Lactate_max)
# Including time x covariate interactions to fix proportional hazards for problematic variables
# Split the dataset at 90 days (~ 3 months)
# Suspect there may be some systematic differences in patients who survive less than or greater than 3 months after ICU admission
ICU.split <- survSplit(Surv(Days, Status) ~ ., data = nm_icu_model_df1, cut=c(90), episode= "tgroup", id="id2")
head(ICU.split)
## RecordID in_hospital_death Age Length_of_stay Gender
## 1 132540 0 76 8 Male
## 2 132540 0 76 8 Male
## 3 132541 0 44 19 Female
## 4 132541 0 44 19 Female
## 5 132543 0 68 9 Male
## 6 132543 0 68 9 Male
## ICUType Weight_max Albumin_min Bilirubin_max BUN_max
## 1 Cardiac Surgery Recovery Unit 80.6 2.2 1.2 18
## 2 Cardiac Surgery Recovery Unit 80.6 2.2 1.2 18
## 3 Medical ICU 56.7 2.3 3.0 8
## 4 Medical ICU 56.7 2.3 3.0 8
## 5 Medical ICU 84.6 4.4 0.2 23
## 6 Medical ICU 84.6 4.4 0.2 23
## Creatinine_max GCS_max Glucose_min Glucose_max HCO3_min HR_min HR_max K_min
## 1 1.2 15 105 105 21 80 88 4.3
## 2 1.2 15 105 105 21 80 88 4.3
## 3 0.4 8 119 141 24 57 113 3.3
## 4 0.4 8 119 141 24 57 113 3.3
## 5 0.9 15 106 129 27 57 88 4.0
## 6 0.9 15 106 129 27 57 88 4.0
## K_max Lactate_max MAP_min Na_min Na_max Platelets_min PFratio pH_min pH_max
## 1 4.3 2.9 43 139 139 164 89 7.34 7.45
## 2 4.3 2.9 43 139 139 164 89 7.34 7.45
## 3 8.6 1.9 71 137 140 72 65 7.51 7.51
## 4 8.6 1.9 71 137 140 72 65 7.51 7.51
## 5 4.2 1.2 72 140 141 315 64 7.47 7.51
## 6 4.2 1.2 72 140 141 315 64 7.47 7.51
## RespRate_min RespRate_max Temp_min Temp_max TroponinT_max TroponinI_max
## 1 11 36 34.5 37.9 0.43 31.7
## 2 11 36 34.5 37.9 0.43 31.7
## 3 18 33 36.7 39.0 1.55 33.4
## 4 18 33 36.7 39.0 1.55 33.4
## 5 12 21 35.1 36.7 0.10 5.9
## 6 12 21 35.1 36.7 0.10 5.9
## Urine_min WBC_min WBC_max id2 tstart Days Status tgroup
## 1 0 7.4 13.1 1 0 90 0 1
## 2 0 7.4 13.1 1 90 2408 0 2
## 3 30 3.7 4.2 2 0 90 0 1
## 4 30 3.7 4.2 2 90 2408 0 2
## 5 100 8.8 11.5 3 0 90 0 1
## 6 100 8.8 11.5 3 90 575 1 2
# Fit the model with time x covariate interactions
ICU.mv_reduced4.split <- coxph(Surv(Days, Status) ~
Age + ICUType:strata(tgroup) +
Albumin_min:strata(tgroup) +
Bilirubin_max:strata(tgroup) + BUN_max +
GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
HR_min:strata(tgroup) +
Lactate_max:strata(tgroup) + Na_max + pH_min +
Temp_max + Urine_min,
data = ICU.split)
summary(ICU.mv_reduced4.split)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + ICUType:strata(tgroup) +
## Albumin_min:strata(tgroup) + Bilirubin_max:strata(tgroup) +
## BUN_max + GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
## HR_min:strata(tgroup) + Lactate_max:strata(tgroup) + Na_max +
## pH_min + Temp_max + Urine_min, data = ICU.split)
##
## n= 3403, number of events= 718
##
## coef
## Age 0.0345650
## BUN_max 0.0101953
## Na_max -0.0381489
## pH_min -0.4336792
## Temp_max -0.1551722
## Urine_min -0.0017471
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.0403660
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 -1.1698719
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.1858220
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.0820908
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 -0.3156108
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.5495362
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min -0.2391643
## strata(tgroup)tgroup=2:Albumin_min 0.0290633
## strata(tgroup)tgroup=1:Bilirubin_max 0.0297681
## strata(tgroup)tgroup=2:Bilirubin_max -0.0157077
## strata(tgroup)tgroup=1:GCS_max -0.1304352
## strata(tgroup)tgroup=2:GCS_max -0.0738932
## strata(tgroup)tgroup=1:HCO3_min -0.0008551
## strata(tgroup)tgroup=2:HCO3_min 0.0406368
## strata(tgroup)tgroup=1:HR_min 0.0091968
## strata(tgroup)tgroup=2:HR_min 0.0019959
## strata(tgroup)tgroup=1:Lactate_max 0.0835164
## strata(tgroup)tgroup=2:Lactate_max -0.0129743
## exp(coef)
## Age 1.0351693
## BUN_max 1.0102474
## Na_max 0.9625696
## pH_min 0.6481201
## Temp_max 0.8562677
## Urine_min 0.9982544
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.0411918
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.3104067
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.2042079
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.0855543
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.7293433
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.7324493
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.7872855
## strata(tgroup)tgroup=2:Albumin_min 1.0294897
## strata(tgroup)tgroup=1:Bilirubin_max 1.0302156
## strata(tgroup)tgroup=2:Bilirubin_max 0.9844150
## strata(tgroup)tgroup=1:GCS_max 0.8777134
## strata(tgroup)tgroup=2:GCS_max 0.9287709
## strata(tgroup)tgroup=1:HCO3_min 0.9991453
## strata(tgroup)tgroup=2:HCO3_min 1.0414737
## strata(tgroup)tgroup=1:HR_min 1.0092393
## strata(tgroup)tgroup=2:HR_min 1.0019979
## strata(tgroup)tgroup=1:Lactate_max 1.0871031
## strata(tgroup)tgroup=2:Lactate_max 0.9871095
## se(coef) z
## Age 0.0027620 12.515
## BUN_max 0.0013851 7.361
## Na_max 0.0078806 -4.841
## pH_min 0.1930492 -2.246
## Temp_max 0.0519360 -2.988
## Urine_min 0.0009372 -1.864
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.1693816 0.238
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.2046499 -5.716
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.1318639 1.409
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 0.0000000 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.1898100 0.432
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.1779403 -1.774
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.1498046 3.668
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 0.0000000 NA
## strata(tgroup)tgroup=1:Albumin_min 0.0877584 -2.725
## strata(tgroup)tgroup=2:Albumin_min 0.0927864 0.313
## strata(tgroup)tgroup=1:Bilirubin_max 0.0081976 3.631
## strata(tgroup)tgroup=2:Bilirubin_max 0.0177122 -0.887
## strata(tgroup)tgroup=1:GCS_max 0.0158934 -8.207
## strata(tgroup)tgroup=2:GCS_max 0.0191736 -3.854
## strata(tgroup)tgroup=1:HCO3_min 0.0115995 -0.074
## strata(tgroup)tgroup=2:HCO3_min 0.0121807 3.336
## strata(tgroup)tgroup=1:HR_min 0.0032487 2.831
## strata(tgroup)tgroup=2:HR_min 0.0038380 0.520
## strata(tgroup)tgroup=1:Lactate_max 0.0207276 4.029
## strata(tgroup)tgroup=2:Lactate_max 0.0345606 -0.375
## Pr(>|z|)
## Age < 2e-16 ***
## BUN_max 1.83e-13 ***
## Na_max 1.29e-06 ***
## pH_min 0.024674 *
## Temp_max 0.002810 **
## Urine_min 0.062284 .
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.811638
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 1.09e-08 ***
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.158777
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.665386
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.076115 .
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.000244 ***
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.006425 **
## strata(tgroup)tgroup=2:Albumin_min 0.754108
## strata(tgroup)tgroup=1:Bilirubin_max 0.000282 ***
## strata(tgroup)tgroup=2:Bilirubin_max 0.375170
## strata(tgroup)tgroup=1:GCS_max 2.27e-16 ***
## strata(tgroup)tgroup=2:GCS_max 0.000116 ***
## strata(tgroup)tgroup=1:HCO3_min 0.941234
## strata(tgroup)tgroup=2:HCO3_min 0.000849 ***
## strata(tgroup)tgroup=1:HR_min 0.004641 **
## strata(tgroup)tgroup=2:HR_min 0.603035
## strata(tgroup)tgroup=1:Lactate_max 5.60e-05 ***
## strata(tgroup)tgroup=2:Lactate_max 0.707357
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef)
## Age 1.0352
## BUN_max 1.0102
## Na_max 0.9626
## pH_min 0.6481
## Temp_max 0.8563
## Urine_min 0.9983
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.0412
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.3104
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.2042
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.0856
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.7293
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.7324
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.7873
## strata(tgroup)tgroup=2:Albumin_min 1.0295
## strata(tgroup)tgroup=1:Bilirubin_max 1.0302
## strata(tgroup)tgroup=2:Bilirubin_max 0.9844
## strata(tgroup)tgroup=1:GCS_max 0.8777
## strata(tgroup)tgroup=2:GCS_max 0.9288
## strata(tgroup)tgroup=1:HCO3_min 0.9991
## strata(tgroup)tgroup=2:HCO3_min 1.0415
## strata(tgroup)tgroup=1:HR_min 1.0092
## strata(tgroup)tgroup=2:HR_min 1.0020
## strata(tgroup)tgroup=1:Lactate_max 1.0871
## strata(tgroup)tgroup=2:Lactate_max 0.9871
## exp(-coef)
## Age 0.9660
## BUN_max 0.9899
## Na_max 1.0389
## pH_min 1.5429
## Temp_max 1.1679
## Urine_min 1.0017
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.9604
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 3.2216
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.8304
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.9212
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 1.3711
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.5772
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 1.2702
## strata(tgroup)tgroup=2:Albumin_min 0.9714
## strata(tgroup)tgroup=1:Bilirubin_max 0.9707
## strata(tgroup)tgroup=2:Bilirubin_max 1.0158
## strata(tgroup)tgroup=1:GCS_max 1.1393
## strata(tgroup)tgroup=2:GCS_max 1.0767
## strata(tgroup)tgroup=1:HCO3_min 1.0009
## strata(tgroup)tgroup=2:HCO3_min 0.9602
## strata(tgroup)tgroup=1:HR_min 0.9908
## strata(tgroup)tgroup=2:HR_min 0.9980
## strata(tgroup)tgroup=1:Lactate_max 0.9199
## strata(tgroup)tgroup=2:Lactate_max 1.0131
## lower .95 upper .95
## Age 1.0296 1.0408
## BUN_max 1.0075 1.0130
## Na_max 0.9478 0.9776
## pH_min 0.4439 0.9462
## Temp_max 0.7734 0.9480
## Urine_min 0.9964 1.0001
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.7471 1.4511
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.2078 0.4636
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.9299 1.5594
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.7483 1.5748
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.5146 1.0337
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.2917 2.3237
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA NA
## strata(tgroup)tgroup=1:Albumin_min 0.6629 0.9350
## strata(tgroup)tgroup=2:Albumin_min 0.8583 1.2348
## strata(tgroup)tgroup=1:Bilirubin_max 1.0138 1.0469
## strata(tgroup)tgroup=2:Bilirubin_max 0.9508 1.0192
## strata(tgroup)tgroup=1:GCS_max 0.8508 0.9055
## strata(tgroup)tgroup=2:GCS_max 0.8945 0.9643
## strata(tgroup)tgroup=1:HCO3_min 0.9767 1.0221
## strata(tgroup)tgroup=2:HCO3_min 1.0169 1.0666
## strata(tgroup)tgroup=1:HR_min 1.0028 1.0157
## strata(tgroup)tgroup=2:HR_min 0.9945 1.0096
## strata(tgroup)tgroup=1:Lactate_max 1.0438 1.1322
## strata(tgroup)tgroup=2:Lactate_max 0.9225 1.0563
##
## Concordance= 0.748 (se = 0.009 )
## Likelihood ratio test= 564.1 on 24 df, p=<2e-16
## Wald test = 545.2 on 24 df, p=<2e-16
## Score (logrank) test = 594 on 24 df, p=<2e-16
# evaluating the proportional hazards assumption again, for the model with time x covariate interactions
cox.zph(ICU.mv_reduced4.split, terms=FALSE)
## chisq df p
## Age 7.54e-02 1 0.784
## BUN_max 4.99e-03 1 0.944
## Na_max 4.35e-01 1 0.510
## pH_min 1.67e-01 1 0.683
## Temp_max 1.87e-01 1 0.665
## Urine_min 1.66e+00 1 0.197
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 6.05e-03 1 0.938
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 6.63e-01 1 0.416
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.42e-04 1 0.990
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.24e-01 1 0.724
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 2.05e+00 1 0.153
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 5.41e-01 1 0.462
## strata(tgroup)tgroup=1:Albumin_min 2.66e+00 1 0.103
## strata(tgroup)tgroup=2:Albumin_min 1.45e-03 1 0.970
## strata(tgroup)tgroup=1:Bilirubin_max 1.03e+00 1 0.311
## strata(tgroup)tgroup=2:Bilirubin_max 3.40e+00 1 0.065
## strata(tgroup)tgroup=1:GCS_max 1.08e+01 1 0.001
## strata(tgroup)tgroup=2:GCS_max 2.42e+00 1 0.120
## strata(tgroup)tgroup=1:HCO3_min 4.75e+00 1 0.029
## strata(tgroup)tgroup=2:HCO3_min 1.57e+00 1 0.210
## strata(tgroup)tgroup=1:HR_min 9.09e-01 1 0.340
## strata(tgroup)tgroup=2:HR_min 3.38e-01 1 0.561
## strata(tgroup)tgroup=1:Lactate_max 5.31e+00 1 0.021
## strata(tgroup)tgroup=2:Lactate_max 5.96e+00 1 0.015
## GLOBAL 3.50e+01 24 0.069
## Result: the global test is now insignificant (p = 0.07)
# Checking Linearity by observing Martingale residuals
# Refit the chosen model with any factor variables re-coded as numeric
# to allow the ggcoxfunctional() function to work
ICU.mv_reduced4.nofactor <- coxph(Surv(Days, Status) ~
Age + as.numeric(ICUType) + Albumin_min + Bilirubin_max + BUN_max +
GCS_max + HCO3_min + HR_min + Lactate_max + Na_max +
pH_min + Temp_max + Urine_min,
data = nm_icu_model_df1)
ggcoxfunctional(ICU.mv_reduced4.nofactor, nm_icu_model_df1)
## Result: Some observations with non-linear residuals, particularly in the extremes of that value
# Check linearity of the model as a whole
ggcoxdiagnostics(ICU.mv_reduced4, type = "martingale", linear.predictions = FALSE, ggtheme = theme_bw())
## `geom_smooth()` using formula 'y ~ x'
## Result: appears reasonably linear with with 2 large negative outliers
## (large negative interpretation = 'lived too long')
# Examine the observations with very large negative residuals (< -3)
resid(ICU.mv_reduced4)[resid(ICU.mv_reduced4) < -3]
## 1511 1929
## -4.231742 -3.224483
icu_patients_df1[c(1511,1929),]
## RecordID Length_of_stay SAPS1 SOFA Survival in_hospital_death Days Status
## 1511 136398 51 22 10 NA 0 2408 FALSE
## 1929 137433 23 NA 7 NA 0 2408 FALSE
## Age Albumin_diff Albumin_max Albumin_min ALP_diff ALP_max ALP_min ALT_diff
## 1511 70 0.0186633 3.0 3.0 50.85204 45 74 105.4462
## 1929 78 0.6813367 2.3 2.3 57.14796 153 153 138.5538
## ALT_max ALT_min AST_diff AST_max AST_min Bilirubin_diff Bilirubin_max
## 1511 40 15 151.3527 18 57 1.364039 0.9
## 1929 259 259 203.6473 373 373 4.935961 6.7
## Bilirubin_min BUN_diff BUN_max BUN_min Cholesterol_diff Cholesterol_max
## 1511 0.4 99.47295 124 120 9.422764 147
## 1929 6.7 97.47295 122 122 81.422764 75
## Cholesterol_min Creatinine_diff Creatinine_max Creatinine_min DiasABP_diff
## 1511 147 5.167554 6.4 5.8 11.54421
## 1929 101 2.967554 4.2 4.2 NA
## DiasABP_max DiasABP_min FiO2_diff FiO2_max FiO2_min GCS_diff GCS_max
## 1511 67 47 0.4480799 1 0.4 6.244029 9
## 1929 NA NA 0.4480799 1 1.0 3.755971 15
## GCS_min Gender Glucose_diff Glucose_max Glucose_min HCO3_diff HCO3_max
## 1511 5 Female 142.14446 282 41 15.772548 10
## 1929 15 Male 66.85554 73 73 0.772548 22
## HCO3_min HCT_diff HCT_max HCT_min Height HR_diff HR_max HR_min
## 1511 7 10.460129 31.5 20.5 165.1 45.07789 70 42
## 1929 22 4.760129 26.2 26.2 177.8 27.07789 65 60
## ICUType K_diff K_max K_min Lactate_diff Lactate_max Lactate_min
## 1511 Medical ICU 0.6352066 3.9 3.5 4.803596 7.6 7.6
## 1929 Medical ICU 0.1352066 4.0 4.0 2.203596 5.0 1.6
## MAP_diff MAP_max MAP_min Mg_diff Mg_max Mg_min Na_diff Na_max Na_min
## 1511 120.23164 198 55 0.1842982 2.0 1.8 8.206607 133 131
## 1929 19.76836 58 65 0.6157018 2.6 2.6 6.206607 133 133
## NIDiasABP_diff NIDiasABP_max NIDiasABP_min NIMAP_diff NIMAP_max NIMAP_min
## 1511 20.49101 72 37 21.38069 84.67 54.33
## 1929 31.49101 82 26 24.04069 93.00 51.67
## NISysABP_diff NISysABP_max NISysABP_min PaCO2_diff PaCO2_max PaCO2_min
## 1511 37.69875 126 79 25.335797 22 15
## 1929 18.69875 119 98 4.335797 40 36
## PaO2_diff PaO2_max PaO2_min pH_diff pH_max pH_min Platelets_diff
## 1511 282.3821 441 120 0.14988624 7.31 7.22 77.76931
## 1929 108.6179 107 50 0.07988624 7.31 7.29 154.23069
## Platelets_max Platelets_min RespRate_diff RespRate_max RespRate_min
## 1511 150 112 10.65142 30 10
## 1929 344 344 11.65142 31 17
## SaO2_diff SaO2_max SaO2_min SysABP_diff SysABP_max SysABP_min Temp_diff
## 1511 0.7539211 98 98 42.3105 126 74 2.574083
## 1929 2.2460789 99 95 NA NA NA 1.174083
## Temp_max Temp_min TroponinI_diff TroponinI_max TroponinI_min
## 1511 36.1 34.4 1.542945 3.9 3.9
## 1929 37.9 35.8 3.742945 3.9 1.7
## TroponinT_diff TroponinT_max TroponinT_min Urine_diff Urine_max Urine_min
## 1511 0.6185006 0.27 0.05 99.21758 70 0
## 1929 3.3414994 4.01 1.67 99.21758 120 0
## WBC_diff WBC_max WBC_min Weight_diff Weight_max Weight_min PFratio
## 1511 3.7331524 9.8 8.4 2.499878 78.2 78.2 120
## 1929 0.6668476 12.8 12.8 4.699878 76.0 76.0 50
## Interpretation: looks like they were relatively elderly with long lengths of stay
## - one had low GCS values/high SAPS1/high lactate
## - the other had high bilirubin/deranged LFTs/high lactate
## Decision: remove these outliers and re-fit the model to the dataset excluding these observations -->
# Check the RecordIDs match up with the correct data in the non-missing, split dataset
ICU.split[(ICU.split$RecordID == 136398 | ICU.split$RecordID == 137433),]
## RecordID in_hospital_death Age Length_of_stay Gender ICUType
## 2477 136398 0 70 51 Female Medical ICU
## 2478 136398 0 70 51 Female Medical ICU
## 3181 137433 0 78 23 Male Medical ICU
## 3182 137433 0 78 23 Male Medical ICU
## Weight_max Albumin_min Bilirubin_max BUN_max Creatinine_max GCS_max
## 2477 78.2 3.0 0.9 124 6.4 9
## 2478 78.2 3.0 0.9 124 6.4 9
## 3181 76.0 2.3 6.7 122 4.2 15
## 3182 76.0 2.3 6.7 122 4.2 15
## Glucose_min Glucose_max HCO3_min HR_min HR_max K_min K_max Lactate_max
## 2477 41 282 7 42 70 3.5 3.9 7.6
## 2478 41 282 7 42 70 3.5 3.9 7.6
## 3181 73 73 22 60 65 4.0 4.0 5.0
## 3182 73 73 22 60 65 4.0 4.0 5.0
## MAP_min Na_min Na_max Platelets_min PFratio pH_min pH_max RespRate_min
## 2477 55 131 133 112 120 7.22 7.31 10
## 2478 55 131 133 112 120 7.22 7.31 10
## 3181 65 133 133 344 50 7.29 7.31 17
## 3182 65 133 133 344 50 7.29 7.31 17
## RespRate_max Temp_min Temp_max TroponinT_max TroponinI_max Urine_min
## 2477 30 34.4 36.1 0.27 3.9 0
## 2478 30 34.4 36.1 0.27 3.9 0
## 3181 31 35.8 37.9 4.01 3.9 0
## 3182 31 35.8 37.9 4.01 3.9 0
## WBC_min WBC_max id2 tstart Days Status tgroup
## 2477 8.4 9.8 1381 0 90 0 1
## 2478 8.4 9.8 1381 90 2408 0 2
## 3181 12.8 12.8 1768 0 90 0 1
## 3182 12.8 12.8 1768 90 2408 0 2
# Remove these observations and save as new dataset
ICU.split_noutliers <- ICU.split[!(ICU.split$RecordID %in% c(136398, 137433)),]
# Refit the split model to the new dataset
ICU.mv_reduced4.split.noutliers <- coxph(Surv(Days, Status) ~
Age + ICUType:strata(tgroup) +
Albumin_min:strata(tgroup) +
Bilirubin_max:strata(tgroup) + BUN_max +
GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
HR_min:strata(tgroup) +
Lactate_max:strata(tgroup) + Na_max + pH_min +
Temp_max + Urine_min,
data = ICU.split_noutliers)
summary(ICU.mv_reduced4.split.noutliers)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + ICUType:strata(tgroup) +
## Albumin_min:strata(tgroup) + Bilirubin_max:strata(tgroup) +
## BUN_max + GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
## HR_min:strata(tgroup) + Lactate_max:strata(tgroup) + Na_max +
## pH_min + Temp_max + Urine_min, data = ICU.split_noutliers)
##
## n= 3399, number of events= 718
##
## coef
## Age 0.0344654
## BUN_max 0.0110476
## Na_max -0.0412625
## pH_min -0.4225172
## Temp_max -0.1602778
## Urine_min -0.0018673
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.0289772
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 -1.1695444
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.1960464
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.0722582
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 -0.3192052
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.5619379
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min -0.2384778
## strata(tgroup)tgroup=2:Albumin_min 0.0256039
## strata(tgroup)tgroup=1:Bilirubin_max 0.0291125
## strata(tgroup)tgroup=2:Bilirubin_max -0.0150638
## strata(tgroup)tgroup=1:GCS_max -0.1300711
## strata(tgroup)tgroup=2:GCS_max -0.0738527
## strata(tgroup)tgroup=1:HCO3_min -0.0023776
## strata(tgroup)tgroup=2:HCO3_min 0.0398038
## strata(tgroup)tgroup=1:HR_min 0.0080794
## strata(tgroup)tgroup=2:HR_min 0.0011417
## strata(tgroup)tgroup=1:Lactate_max 0.0893313
## strata(tgroup)tgroup=2:Lactate_max -0.0016393
## exp(coef)
## Age 1.0350662
## BUN_max 1.0111088
## Na_max 0.9595772
## pH_min 0.6553950
## Temp_max 0.8519071
## Urine_min 0.9981344
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.0294012
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.3105084
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.2165834
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.0749329
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.7267264
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.7540684
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.7878262
## strata(tgroup)tgroup=2:Albumin_min 1.0259345
## strata(tgroup)tgroup=1:Bilirubin_max 1.0295404
## strata(tgroup)tgroup=2:Bilirubin_max 0.9850491
## strata(tgroup)tgroup=1:GCS_max 0.8780330
## strata(tgroup)tgroup=2:GCS_max 0.9288085
## strata(tgroup)tgroup=1:HCO3_min 0.9976252
## strata(tgroup)tgroup=2:HCO3_min 1.0406066
## strata(tgroup)tgroup=1:HR_min 1.0081121
## strata(tgroup)tgroup=2:HR_min 1.0011423
## strata(tgroup)tgroup=1:Lactate_max 1.0934429
## strata(tgroup)tgroup=2:Lactate_max 0.9983620
## se(coef) z
## Age 0.0027545 12.512
## BUN_max 0.0013785 8.014
## Na_max 0.0078750 -5.240
## pH_min 0.1960270 -2.155
## Temp_max 0.0521518 -3.073
## Urine_min 0.0009442 -1.978
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.1694234 0.171
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.2046832 -5.714
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.1316976 1.489
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 0.0000000 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.1898599 0.381
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.1779046 -1.794
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.1498111 3.751
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 0.0000000 NA
## strata(tgroup)tgroup=1:Albumin_min 0.0876078 -2.722
## strata(tgroup)tgroup=2:Albumin_min 0.0927818 0.276
## strata(tgroup)tgroup=1:Bilirubin_max 0.0081707 3.563
## strata(tgroup)tgroup=2:Bilirubin_max 0.0173936 -0.866
## strata(tgroup)tgroup=1:GCS_max 0.0158746 -8.194
## strata(tgroup)tgroup=2:GCS_max 0.0191511 -3.856
## strata(tgroup)tgroup=1:HCO3_min 0.0117270 -0.203
## strata(tgroup)tgroup=2:HCO3_min 0.0122736 3.243
## strata(tgroup)tgroup=1:HR_min 0.0032678 2.472
## strata(tgroup)tgroup=2:HR_min 0.0038574 0.296
## strata(tgroup)tgroup=1:Lactate_max 0.0204113 4.377
## strata(tgroup)tgroup=2:Lactate_max 0.0343856 -0.048
## Pr(>|z|)
## Age < 2e-16 ***
## BUN_max 1.11e-15 ***
## Na_max 1.61e-07 ***
## pH_min 0.031130 *
## Temp_max 0.002117 **
## Urine_min 0.047971 *
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.864197
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 1.10e-08 ***
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.136590
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.703510
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.072773 .
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.000176 ***
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.006487 **
## strata(tgroup)tgroup=2:Albumin_min 0.782580
## strata(tgroup)tgroup=1:Bilirubin_max 0.000367 ***
## strata(tgroup)tgroup=2:Bilirubin_max 0.386459
## strata(tgroup)tgroup=1:GCS_max 2.53e-16 ***
## strata(tgroup)tgroup=2:GCS_max 0.000115 ***
## strata(tgroup)tgroup=1:HCO3_min 0.839330
## strata(tgroup)tgroup=2:HCO3_min 0.001183 **
## strata(tgroup)tgroup=1:HR_min 0.013420 *
## strata(tgroup)tgroup=2:HR_min 0.767252
## strata(tgroup)tgroup=1:Lactate_max 1.21e-05 ***
## strata(tgroup)tgroup=2:Lactate_max 0.961975
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef)
## Age 1.0351
## BUN_max 1.0111
## Na_max 0.9596
## pH_min 0.6554
## Temp_max 0.8519
## Urine_min 0.9981
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.0294
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.3105
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.2166
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.0749
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.7267
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.7541
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.7878
## strata(tgroup)tgroup=2:Albumin_min 1.0259
## strata(tgroup)tgroup=1:Bilirubin_max 1.0295
## strata(tgroup)tgroup=2:Bilirubin_max 0.9850
## strata(tgroup)tgroup=1:GCS_max 0.8780
## strata(tgroup)tgroup=2:GCS_max 0.9288
## strata(tgroup)tgroup=1:HCO3_min 0.9976
## strata(tgroup)tgroup=2:HCO3_min 1.0406
## strata(tgroup)tgroup=1:HR_min 1.0081
## strata(tgroup)tgroup=2:HR_min 1.0011
## strata(tgroup)tgroup=1:Lactate_max 1.0934
## strata(tgroup)tgroup=2:Lactate_max 0.9984
## exp(-coef)
## Age 0.9661
## BUN_max 0.9890
## Na_max 1.0421
## pH_min 1.5258
## Temp_max 1.1738
## Urine_min 1.0019
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.9714
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 3.2205
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.8220
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.9303
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 1.3760
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.5701
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 1.2693
## strata(tgroup)tgroup=2:Albumin_min 0.9747
## strata(tgroup)tgroup=1:Bilirubin_max 0.9713
## strata(tgroup)tgroup=2:Bilirubin_max 1.0152
## strata(tgroup)tgroup=1:GCS_max 1.1389
## strata(tgroup)tgroup=2:GCS_max 1.0766
## strata(tgroup)tgroup=1:HCO3_min 1.0024
## strata(tgroup)tgroup=2:HCO3_min 0.9610
## strata(tgroup)tgroup=1:HR_min 0.9920
## strata(tgroup)tgroup=2:HR_min 0.9989
## strata(tgroup)tgroup=1:Lactate_max 0.9145
## strata(tgroup)tgroup=2:Lactate_max 1.0016
## lower .95 upper .95
## Age 1.0295 1.0407
## BUN_max 1.0084 1.0138
## Na_max 0.9449 0.9745
## pH_min 0.4463 0.9624
## Temp_max 0.7691 0.9436
## Urine_min 0.9963 1.0000
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.7385 1.4348
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.2079 0.4638
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.9398 1.5749
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.7409 1.5595
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.5128 1.0299
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.3078 2.3527
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA NA
## strata(tgroup)tgroup=1:Albumin_min 0.6635 0.9354
## strata(tgroup)tgroup=2:Albumin_min 0.8553 1.2305
## strata(tgroup)tgroup=1:Bilirubin_max 1.0132 1.0462
## strata(tgroup)tgroup=2:Bilirubin_max 0.9520 1.0192
## strata(tgroup)tgroup=1:GCS_max 0.8511 0.9058
## strata(tgroup)tgroup=2:GCS_max 0.8946 0.9643
## strata(tgroup)tgroup=1:HCO3_min 0.9750 1.0208
## strata(tgroup)tgroup=2:HCO3_min 1.0159 1.0659
## strata(tgroup)tgroup=1:HR_min 1.0017 1.0146
## strata(tgroup)tgroup=2:HR_min 0.9936 1.0087
## strata(tgroup)tgroup=1:Lactate_max 1.0506 1.1381
## strata(tgroup)tgroup=2:Lactate_max 0.9333 1.0680
##
## Concordance= 0.749 (se = 0.009 )
## Likelihood ratio test= 576.5 on 24 df, p=<2e-16
## Wald test = 558.9 on 24 df, p=<2e-16
## Score (logrank) test = 608.5 on 24 df, p=<2e-16
# Calculate the split/no outlier model AIC
AIC.mv_reduced4.split.noutliers <- calc_aic(ICU.mv_reduced4.split.noutliers)
AIC.mv_reduced4.split.noutliers
## [1] 9992.763
## Decision: use the 4th reduced model, split at time 3 months (90 days) on the split dataset with the outliers removed as the final dataset
# Difference in Coefficients
ICU.mv_reduced4.split.noutliers$coefficients
## Age
## 0.034465370
## BUN_max
## 0.011047577
## Na_max
## -0.041262466
## pH_min
## -0.422517197
## Temp_max
## -0.160277779
## Urine_min
## -0.001867308
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1
## 0.028977228
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1
## -1.169544377
## ICUTypeMedical ICU:strata(tgroup)tgroup=1
## 0.196046432
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1
## NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2
## 0.072258237
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2
## -0.319205230
## ICUTypeMedical ICU:strata(tgroup)tgroup=2
## 0.561937865
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2
## NA
## strata(tgroup)tgroup=1:Albumin_min
## -0.238477810
## strata(tgroup)tgroup=2:Albumin_min
## 0.025603864
## strata(tgroup)tgroup=1:Bilirubin_max
## 0.029112532
## strata(tgroup)tgroup=2:Bilirubin_max
## -0.015063841
## strata(tgroup)tgroup=1:GCS_max
## -0.130071126
## strata(tgroup)tgroup=2:GCS_max
## -0.073852740
## strata(tgroup)tgroup=1:HCO3_min
## -0.002377648
## strata(tgroup)tgroup=2:HCO3_min
## 0.039803800
## strata(tgroup)tgroup=1:HR_min
## 0.008079371
## strata(tgroup)tgroup=2:HR_min
## 0.001141679
## strata(tgroup)tgroup=1:Lactate_max
## 0.089331349
## strata(tgroup)tgroup=2:Lactate_max
## -0.001639347
ICU.mv_reduced4.split$coefficients
## Age
## 0.0345650261
## BUN_max
## 0.0101952798
## Na_max
## -0.0381488973
## pH_min
## -0.4336792152
## Temp_max
## -0.1551722232
## Urine_min
## -0.0017471016
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1
## 0.0403659717
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1
## -1.1698718792
## ICUTypeMedical ICU:strata(tgroup)tgroup=1
## 0.1858220254
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1
## NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2
## 0.0820907504
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2
## -0.3156107505
## ICUTypeMedical ICU:strata(tgroup)tgroup=2
## 0.5495361645
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2
## NA
## strata(tgroup)tgroup=1:Albumin_min
## -0.2391642695
## strata(tgroup)tgroup=2:Albumin_min
## 0.0290632782
## strata(tgroup)tgroup=1:Bilirubin_max
## 0.0297681206
## strata(tgroup)tgroup=2:Bilirubin_max
## -0.0157076745
## strata(tgroup)tgroup=1:GCS_max
## -0.1304352133
## strata(tgroup)tgroup=2:GCS_max
## -0.0738932198
## strata(tgroup)tgroup=1:HCO3_min
## -0.0008551014
## strata(tgroup)tgroup=2:HCO3_min
## 0.0406367675
## strata(tgroup)tgroup=1:HR_min
## 0.0091968433
## strata(tgroup)tgroup=2:HR_min
## 0.0019958999
## strata(tgroup)tgroup=1:Lactate_max
## 0.0835164347
## strata(tgroup)tgroup=2:Lactate_max
## -0.0129743471
We need to test whether the chosen model satisfies the assumptions underlying the Cox Proportional Hazards model.
Proportional hazard assumption is supported by a non-significant relationship between residuals and time, while a significant relationship favours the null of non-constant hazards.
The output from the proportional hazards test shows that the test is statistically significant (p-value < 0.05) for ICUType, Albumin_min, Bilirubin_max, GCS_max, HCO3_min, HR_min and Lactate_max. The global test is also statistically significant (p-value is very small = 1.6e-12). Therefore, there appears to be a violation of the proportional hazards model.
We choose to address the violations of the proportional hazards assumption by including time x covariate interactions in the model for the variables that violated the proportional hazards assumption. By looking at the survival curve and the assumption that there may be systematic differences in patients who survive less than or greater than 3 months after ICU admission, we choose a post ICU survival time of 90 days.
The hazard rate increases at varying rates for the population who survived less than 90 days. Looking at the exponential of the coefficients gives us an estimate of the hazard rate related to each covariate.
ICUType - the reference group is those in Surgical ICU. Those in Medical ICU are 21.6% more likely to die than those is surgical ICU within the first 90 days. For those who survive the first 90 days, this risk increases to 75.4%. For those in Cardiac SUrgery Recovery Unit, the risk is 70% lower than Surgical ICU for those who survive less than 90 days. This changes to 30% lower than risk for Surgical ICU for those who survive more than 90 days.Albumin_min - for every additional unit of Albumin, the risk of mortality is 22% lower for those that die within the first 90 days. For those that survive more than 90 days, the risk of mortality does not significantly differ by level of Albumin as the confidence interval for the second period includes the value 1.Bilirubin_max - the impact on mortality risk is not significant for either time period as the confidence interval includes 1.GCS_max - for every additional unit of GCS, the mortality risk is reduced significantly in both periods. For the first 90 days, the risk is reduced by 12%. For the subsequent period, the risk is reduced by 7%.HCO3_min - for the first time period (< 90 days) there is no significant difference in mortality risk by level of HCO3. However, in the subsequent period, every additional unit of HCO3 results in an increased mortality by 4%.HR_min - for every additional 10 beats per minute, there is a 8% increase in mortality for those that die within the first 90 days. The difference is not significant for patients who survive more than 90 days.Lactate - for every additional unit of Lactate, there us 9% increase in mortality risk for those who die within the first 90 days. The difference is not significant for the subsequent period.Allowing the regression coefficients to differ in the two time intervals (before 90 days and after) has helped address the violation of the PH assumption. The global test for our model is no longer significant (p-value =0.07).
The overall model residuals appear reasonably linear around 0. However, we do observe 2 very large negative outliers (individuals whose actual survival time was significantly greater than estimated by the model. On closer observation, these 2 individuals were relatively elderly with long lengths of stay in hospital. One had low GCS values, high SAPS1, high lactate whilst the other had high bilirubin, deranged LFTs and high lactate, all indicators of high risk of mortality.
We have removed these outliers observations and re-fit the model to the dataset excluding these observations. The model fit has improved (with AIC now 9,993 compared to 10,047). The resulting changes in coefficient estimates are insignificant.
# The final model chosen after checking and addressing assumptions
# (the same model as above: ICU.mv_reduced4.split.noutliers)
ICU.final.cox <- coxph(Surv(Days, Status) ~
Age + ICUType:strata(tgroup) +
Albumin_min:strata(tgroup) +
Bilirubin_max:strata(tgroup) + BUN_max +
GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
HR_min:strata(tgroup) + Lactate_max:strata(tgroup) +
Na_max + pH_min + Temp_max + Urine_min,
data = ICU.split_noutliers)
summary(ICU.final.cox)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + ICUType:strata(tgroup) +
## Albumin_min:strata(tgroup) + Bilirubin_max:strata(tgroup) +
## BUN_max + GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
## HR_min:strata(tgroup) + Lactate_max:strata(tgroup) + Na_max +
## pH_min + Temp_max + Urine_min, data = ICU.split_noutliers)
##
## n= 3399, number of events= 718
##
## coef
## Age 0.0344654
## BUN_max 0.0110476
## Na_max -0.0412625
## pH_min -0.4225172
## Temp_max -0.1602778
## Urine_min -0.0018673
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.0289772
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 -1.1695444
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.1960464
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.0722582
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 -0.3192052
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.5619379
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min -0.2384778
## strata(tgroup)tgroup=2:Albumin_min 0.0256039
## strata(tgroup)tgroup=1:Bilirubin_max 0.0291125
## strata(tgroup)tgroup=2:Bilirubin_max -0.0150638
## strata(tgroup)tgroup=1:GCS_max -0.1300711
## strata(tgroup)tgroup=2:GCS_max -0.0738527
## strata(tgroup)tgroup=1:HCO3_min -0.0023776
## strata(tgroup)tgroup=2:HCO3_min 0.0398038
## strata(tgroup)tgroup=1:HR_min 0.0080794
## strata(tgroup)tgroup=2:HR_min 0.0011417
## strata(tgroup)tgroup=1:Lactate_max 0.0893313
## strata(tgroup)tgroup=2:Lactate_max -0.0016393
## exp(coef)
## Age 1.0350662
## BUN_max 1.0111088
## Na_max 0.9595772
## pH_min 0.6553950
## Temp_max 0.8519071
## Urine_min 0.9981344
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.0294012
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.3105084
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.2165834
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.0749329
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.7267264
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.7540684
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.7878262
## strata(tgroup)tgroup=2:Albumin_min 1.0259345
## strata(tgroup)tgroup=1:Bilirubin_max 1.0295404
## strata(tgroup)tgroup=2:Bilirubin_max 0.9850491
## strata(tgroup)tgroup=1:GCS_max 0.8780330
## strata(tgroup)tgroup=2:GCS_max 0.9288085
## strata(tgroup)tgroup=1:HCO3_min 0.9976252
## strata(tgroup)tgroup=2:HCO3_min 1.0406066
## strata(tgroup)tgroup=1:HR_min 1.0081121
## strata(tgroup)tgroup=2:HR_min 1.0011423
## strata(tgroup)tgroup=1:Lactate_max 1.0934429
## strata(tgroup)tgroup=2:Lactate_max 0.9983620
## se(coef) z
## Age 0.0027545 12.512
## BUN_max 0.0013785 8.014
## Na_max 0.0078750 -5.240
## pH_min 0.1960270 -2.155
## Temp_max 0.0521518 -3.073
## Urine_min 0.0009442 -1.978
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.1694234 0.171
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.2046832 -5.714
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.1316976 1.489
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 0.0000000 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.1898599 0.381
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.1779046 -1.794
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.1498111 3.751
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 0.0000000 NA
## strata(tgroup)tgroup=1:Albumin_min 0.0876078 -2.722
## strata(tgroup)tgroup=2:Albumin_min 0.0927818 0.276
## strata(tgroup)tgroup=1:Bilirubin_max 0.0081707 3.563
## strata(tgroup)tgroup=2:Bilirubin_max 0.0173936 -0.866
## strata(tgroup)tgroup=1:GCS_max 0.0158746 -8.194
## strata(tgroup)tgroup=2:GCS_max 0.0191511 -3.856
## strata(tgroup)tgroup=1:HCO3_min 0.0117270 -0.203
## strata(tgroup)tgroup=2:HCO3_min 0.0122736 3.243
## strata(tgroup)tgroup=1:HR_min 0.0032678 2.472
## strata(tgroup)tgroup=2:HR_min 0.0038574 0.296
## strata(tgroup)tgroup=1:Lactate_max 0.0204113 4.377
## strata(tgroup)tgroup=2:Lactate_max 0.0343856 -0.048
## Pr(>|z|)
## Age < 2e-16 ***
## BUN_max 1.11e-15 ***
## Na_max 1.61e-07 ***
## pH_min 0.031130 *
## Temp_max 0.002117 **
## Urine_min 0.047971 *
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.864197
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 1.10e-08 ***
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.136590
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.703510
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.072773 .
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.000176 ***
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.006487 **
## strata(tgroup)tgroup=2:Albumin_min 0.782580
## strata(tgroup)tgroup=1:Bilirubin_max 0.000367 ***
## strata(tgroup)tgroup=2:Bilirubin_max 0.386459
## strata(tgroup)tgroup=1:GCS_max 2.53e-16 ***
## strata(tgroup)tgroup=2:GCS_max 0.000115 ***
## strata(tgroup)tgroup=1:HCO3_min 0.839330
## strata(tgroup)tgroup=2:HCO3_min 0.001183 **
## strata(tgroup)tgroup=1:HR_min 0.013420 *
## strata(tgroup)tgroup=2:HR_min 0.767252
## strata(tgroup)tgroup=1:Lactate_max 1.21e-05 ***
## strata(tgroup)tgroup=2:Lactate_max 0.961975
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef)
## Age 1.0351
## BUN_max 1.0111
## Na_max 0.9596
## pH_min 0.6554
## Temp_max 0.8519
## Urine_min 0.9981
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.0294
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.3105
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.2166
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.0749
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.7267
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.7541
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.7878
## strata(tgroup)tgroup=2:Albumin_min 1.0259
## strata(tgroup)tgroup=1:Bilirubin_max 1.0295
## strata(tgroup)tgroup=2:Bilirubin_max 0.9850
## strata(tgroup)tgroup=1:GCS_max 0.8780
## strata(tgroup)tgroup=2:GCS_max 0.9288
## strata(tgroup)tgroup=1:HCO3_min 0.9976
## strata(tgroup)tgroup=2:HCO3_min 1.0406
## strata(tgroup)tgroup=1:HR_min 1.0081
## strata(tgroup)tgroup=2:HR_min 1.0011
## strata(tgroup)tgroup=1:Lactate_max 1.0934
## strata(tgroup)tgroup=2:Lactate_max 0.9984
## exp(-coef)
## Age 0.9661
## BUN_max 0.9890
## Na_max 1.0421
## pH_min 1.5258
## Temp_max 1.1738
## Urine_min 1.0019
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.9714
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 3.2205
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.8220
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.9303
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 1.3760
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.5701
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 1.2693
## strata(tgroup)tgroup=2:Albumin_min 0.9747
## strata(tgroup)tgroup=1:Bilirubin_max 0.9713
## strata(tgroup)tgroup=2:Bilirubin_max 1.0152
## strata(tgroup)tgroup=1:GCS_max 1.1389
## strata(tgroup)tgroup=2:GCS_max 1.0766
## strata(tgroup)tgroup=1:HCO3_min 1.0024
## strata(tgroup)tgroup=2:HCO3_min 0.9610
## strata(tgroup)tgroup=1:HR_min 0.9920
## strata(tgroup)tgroup=2:HR_min 0.9989
## strata(tgroup)tgroup=1:Lactate_max 0.9145
## strata(tgroup)tgroup=2:Lactate_max 1.0016
## lower .95 upper .95
## Age 1.0295 1.0407
## BUN_max 1.0084 1.0138
## Na_max 0.9449 0.9745
## pH_min 0.4463 0.9624
## Temp_max 0.7691 0.9436
## Urine_min 0.9963 1.0000
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.7385 1.4348
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.2079 0.4638
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.9398 1.5749
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.7409 1.5595
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.5128 1.0299
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 1.3078 2.3527
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA NA
## strata(tgroup)tgroup=1:Albumin_min 0.6635 0.9354
## strata(tgroup)tgroup=2:Albumin_min 0.8553 1.2305
## strata(tgroup)tgroup=1:Bilirubin_max 1.0132 1.0462
## strata(tgroup)tgroup=2:Bilirubin_max 0.9520 1.0192
## strata(tgroup)tgroup=1:GCS_max 0.8511 0.9058
## strata(tgroup)tgroup=2:GCS_max 0.8946 0.9643
## strata(tgroup)tgroup=1:HCO3_min 0.9750 1.0208
## strata(tgroup)tgroup=2:HCO3_min 1.0159 1.0659
## strata(tgroup)tgroup=1:HR_min 1.0017 1.0146
## strata(tgroup)tgroup=2:HR_min 0.9936 1.0087
## strata(tgroup)tgroup=1:Lactate_max 1.0506 1.1381
## strata(tgroup)tgroup=2:Lactate_max 0.9333 1.0680
##
## Concordance= 0.749 (se = 0.009 )
## Likelihood ratio test= 576.5 on 24 df, p=<2e-16
## Wald test = 558.9 on 24 df, p=<2e-16
## Score (logrank) test = 608.5 on 24 df, p=<2e-16
Age - for every additional year of survival, the difference in mortality risk is significant, increasing by 3.5% with a 95% confidence that this increase could range between 2.95% and 4.07% per year.BUN_max - for every additional unit of maximum urea, difference in mortality risk is significant, increasing by 1.1% (95% confidence between 0.8% and 1.4%).Na_max - for every additional unit of maximum sodium, difference in mortality risk is significant, decreasing by 4% (95% confidence between 3.5% and 5.5%).pH_min - for every additional unit of minimum pH, risk of mortality decreases in 35% but the 95% confidence interval is large, ranging between a reduction of 4% and 55%). This could be due to the sensitivity of the measure as humans are highly unlikely to increase or decrease pH by 1 whole unit (normal pH range is narrow: 7.35-7.45).Temp_max - for every additional unit of maximum temperature, mortality risk decreases by 15% (95% confidence interval between 5% and 23%).Urine_max - for every additional 10mL of maximum urine output, the risk of mortality decreases by 2% (confidence interval between 0% and 4%).ICUType - the reference group is those in Surgical ICU. Those in Medical ICU are 21.6% more likely to die than those in surgical ICU within the first 90 days. For those who survive the first 90 days, this risk increases to 75.4%. For those in Cardiac Surgery Recovery Unit, the risk is 70% lower than Surgical ICU for those who survive less than 90 days. This changes to 30% lower than risk for Surgical ICU for those who survive more than 90 days.Albumin_min - for every additional unit of minimum albumin, the risk of mortality is 22% lower for those that die within the first 90 days. For those that survive more than 90 days, the risk of mortality does not significantly differ by level of Albumin as the confidence interval for the second period includes the value 1.Bilirubin_max - the impact on mortality risk is not significant for either time period as the confidence interval includes 1.GCS_max - for every additional unit of maximum GCS score, the mortality risk is reduced significantly in both periods. For the first 90 days, the risk is reduced by 12%. For the subsequent period, the risk is reduced by 7%.HCO3_min - for the first time period (< 90 days) there is no significant difference in mortality risk by minimum level of HCO3. However, in the subsequent period, every additional unit of minimum HCO3 results in an increased mortality by 4%.HR_min - for every additional 10 beats per minute in the minimum recorded HR, there is a 8% increase in mortality for those that die within the first 90 days. The difference is not significant for patients who survive more than 90 days.Lactate_max - for every additional unit of maximum lactate, there us 9% increase in mortality risk for those who die within the first 90 days. The difference is not significant for the subsequent period.# PH test
cox.zph(ICU.final.cox, terms=FALSE)
## chisq df p
## Age 0.05858 1 0.8087
## BUN_max 0.10506 1 0.7458
## Na_max 0.36603 1 0.5452
## pH_min 0.15824 1 0.6908
## Temp_max 0.22101 1 0.6383
## Urine_min 1.61883 1 0.2033
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.00916 1 0.9237
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.61426 1 0.4332
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.00260 1 0.9593
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.13012 1 0.7183
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 2.01272 1 0.1560
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.50100 1 0.4791
## strata(tgroup)tgroup=1:Albumin_min 2.56663 1 0.1091
## strata(tgroup)tgroup=2:Albumin_min 0.00102 1 0.9745
## strata(tgroup)tgroup=1:Bilirubin_max 0.94326 1 0.3314
## strata(tgroup)tgroup=2:Bilirubin_max 3.27393 1 0.0704
## strata(tgroup)tgroup=1:GCS_max 10.58216 1 0.0011
## strata(tgroup)tgroup=2:GCS_max 2.38335 1 0.1226
## strata(tgroup)tgroup=1:HCO3_min 4.44446 1 0.0350
## strata(tgroup)tgroup=2:HCO3_min 1.52648 1 0.2166
## strata(tgroup)tgroup=1:HR_min 1.05685 1 0.3039
## strata(tgroup)tgroup=2:HR_min 0.37304 1 0.5414
## strata(tgroup)tgroup=1:Lactate_max 4.46437 1 0.0346
## strata(tgroup)tgroup=2:Lactate_max 5.80699 1 0.0160
## GLOBAL 34.05298 24 0.0837
# Graph of Schoenfeld residuals
ggcoxdiagnostics(ICU.final.cox, type = "schoenfeld", title = "Diagnostic plot")
## `geom_smooth()` using formula 'y ~ x'
Final Model Diagnostics:
Proportional hazard assumption is supported by a non-significant relationship between residuals and time, while a significant relationship favours the null of non-constant hazards. The global test on the final model is not statistically significant (p-value is 0.08). Therefore, there does not appear to be a violation of the proportional hazards assumption.
The output from the proportional hazards test shows that the test is statistically significant at a 5% significance level for GCS_max, HCO3_min, and Lactate_max, though improved from before incorporating time x covariate split.
The Schoenfeld residuals represent the difference between the observed covariates and expected value for the individuals who failed (i.e. did not survive). In the graphs of the scaled Schoenfeld residuals, the blue dotted line is a smoothing spline fit to the residuals (black dots), with the dashed red line representing the zero line. Systematic departures from the red horizontal line are indicative of non-proportional hazards, since proportional hazards assumes that estimates do not vary much over time. Graphical inspection does not show systematic departures from the zero line over time.
##Compare model on df0 to df1
# Remove the missing data for the variables in the final model
# (this is what R would have done anyway when fitting to the model with missing data, as we saw in Task 1)
nm_icu_model_df0 <- na.omit(subset(icu_patients_df0,
select=c(Days, Status,
RecordID,
Age, ICUType, Albumin_min,
Bilirubin_max, BUN_max, GCS_max,
HCO3_min, HR_min, Lactate_max, Na_max,
pH_min, Temp_max, Urine_min)))
dim(nm_icu_model_df0)
## [1] 299 16
# Split the df0 dataset at the 90 day time point to allow direct comparison to the chosen final model
ICUdf0.split <- survSplit(Surv(Days, Status) ~ ., data = nm_icu_model_df0, cut=c(90), episode= "tgroup", id="id2")
# Refit the model to the df0, split dataset
ICU.final.coxdf0 <- coxph(Surv(Days, Status) ~
Age + ICUType:strata(tgroup) +
Albumin_min:strata(tgroup) +
Bilirubin_max:strata(tgroup) + BUN_max +
GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
HR_min:strata(tgroup) + Lactate_max:strata(tgroup) +
Na_max + pH_min + Temp_max + Urine_min,
data = ICUdf0.split)
summary(ICU.final.coxdf0)
## Call:
## coxph(formula = Surv(Days, Status) ~ Age + ICUType:strata(tgroup) +
## Albumin_min:strata(tgroup) + Bilirubin_max:strata(tgroup) +
## BUN_max + GCS_max:strata(tgroup) + HCO3_min:strata(tgroup) +
## HR_min:strata(tgroup) + Lactate_max:strata(tgroup) + Na_max +
## pH_min + Temp_max + Urine_min, data = ICUdf0.split)
##
## n= 521, number of events= 123
##
## coef
## Age 0.0308044
## BUN_max 0.0100748
## Na_max -0.0292607
## pH_min -1.9164019
## Temp_max 0.0199181
## Urine_min 0.0005413
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.4507477
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 -2.4418221
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.4491899
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 -0.3107640
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.3418326
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.7695124
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min -0.4813815
## strata(tgroup)tgroup=2:Albumin_min -0.5003112
## strata(tgroup)tgroup=1:Bilirubin_max 0.0396806
## strata(tgroup)tgroup=2:Bilirubin_max 0.0404057
## strata(tgroup)tgroup=1:GCS_max -0.0875339
## strata(tgroup)tgroup=2:GCS_max 0.0024367
## strata(tgroup)tgroup=1:HCO3_min 0.0131254
## strata(tgroup)tgroup=2:HCO3_min 0.0986484
## strata(tgroup)tgroup=1:HR_min 0.0093436
## strata(tgroup)tgroup=2:HR_min -0.0102991
## strata(tgroup)tgroup=1:Lactate_max 0.0666912
## strata(tgroup)tgroup=2:Lactate_max -0.0140842
## exp(coef)
## Age 1.0312838
## BUN_max 1.0101257
## Na_max 0.9711633
## pH_min 0.1471354
## Temp_max 1.0201178
## Urine_min 1.0005414
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.5694852
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.0870022
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.5670422
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.7328868
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 1.4075247
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 2.1587134
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.6179291
## strata(tgroup)tgroup=2:Albumin_min 0.6063419
## strata(tgroup)tgroup=1:Bilirubin_max 1.0404784
## strata(tgroup)tgroup=2:Bilirubin_max 1.0412331
## strata(tgroup)tgroup=1:GCS_max 0.9161878
## strata(tgroup)tgroup=2:GCS_max 1.0024397
## strata(tgroup)tgroup=1:HCO3_min 1.0132119
## strata(tgroup)tgroup=2:HCO3_min 1.1036782
## strata(tgroup)tgroup=1:HR_min 1.0093873
## strata(tgroup)tgroup=2:HR_min 0.9897538
## strata(tgroup)tgroup=1:Lactate_max 1.0689654
## strata(tgroup)tgroup=2:Lactate_max 0.9860145
## se(coef) z
## Age 0.0062516 4.927
## BUN_max 0.0028836 3.494
## Na_max 0.0203191 -1.440
## pH_min 0.9990481 -1.918
## Temp_max 0.1206279 0.165
## Urine_min 0.0032598 0.166
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.4818259 0.935
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 1.0372018 -2.354
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.2896715 1.551
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 0.0000000 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.8194792 -0.379
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.5020358 0.681
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.4141223 1.858
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 0.0000000 NA
## strata(tgroup)tgroup=1:Albumin_min 0.2051333 -2.347
## strata(tgroup)tgroup=2:Albumin_min 0.2791597 -1.792
## strata(tgroup)tgroup=1:Bilirubin_max 0.0177289 2.238
## strata(tgroup)tgroup=2:Bilirubin_max 0.0400231 1.010
## strata(tgroup)tgroup=1:GCS_max 0.0348508 -2.512
## strata(tgroup)tgroup=2:GCS_max 0.0474839 0.051
## strata(tgroup)tgroup=1:HCO3_min 0.0246870 0.532
## strata(tgroup)tgroup=2:HCO3_min 0.0294466 3.350
## strata(tgroup)tgroup=1:HR_min 0.0076902 1.215
## strata(tgroup)tgroup=2:HR_min 0.0112699 -0.914
## strata(tgroup)tgroup=1:Lactate_max 0.0444354 1.501
## strata(tgroup)tgroup=2:Lactate_max 0.0747284 -0.188
## Pr(>|z|)
## Age 8.33e-07 ***
## BUN_max 0.000476 ***
## Na_max 0.149851
## pH_min 0.055082 .
## Temp_max 0.868849
## Urine_min 0.868123
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.349531
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.018561 *
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.120977
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.704524
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.495939
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.063144 .
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.018942 *
## strata(tgroup)tgroup=2:Albumin_min 0.073100 .
## strata(tgroup)tgroup=1:Bilirubin_max 0.025209 *
## strata(tgroup)tgroup=2:Bilirubin_max 0.312706
## strata(tgroup)tgroup=1:GCS_max 0.012016 *
## strata(tgroup)tgroup=2:GCS_max 0.959074
## strata(tgroup)tgroup=1:HCO3_min 0.594952
## strata(tgroup)tgroup=2:HCO3_min 0.000808 ***
## strata(tgroup)tgroup=1:HR_min 0.224367
## strata(tgroup)tgroup=2:HR_min 0.360793
## strata(tgroup)tgroup=1:Lactate_max 0.133392
## strata(tgroup)tgroup=2:Lactate_max 0.850507
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef)
## Age 1.0313
## BUN_max 1.0101
## Na_max 0.9712
## pH_min 0.1471
## Temp_max 1.0201
## Urine_min 1.0005
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 1.5695
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.0870
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 1.5670
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.7329
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 1.4075
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 2.1587
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 0.6179
## strata(tgroup)tgroup=2:Albumin_min 0.6063
## strata(tgroup)tgroup=1:Bilirubin_max 1.0405
## strata(tgroup)tgroup=2:Bilirubin_max 1.0412
## strata(tgroup)tgroup=1:GCS_max 0.9162
## strata(tgroup)tgroup=2:GCS_max 1.0024
## strata(tgroup)tgroup=1:HCO3_min 1.0132
## strata(tgroup)tgroup=2:HCO3_min 1.1037
## strata(tgroup)tgroup=1:HR_min 1.0094
## strata(tgroup)tgroup=2:HR_min 0.9898
## strata(tgroup)tgroup=1:Lactate_max 1.0690
## strata(tgroup)tgroup=2:Lactate_max 0.9860
## exp(-coef)
## Age 0.9697
## BUN_max 0.9900
## Na_max 1.0297
## pH_min 6.7965
## Temp_max 0.9803
## Urine_min 0.9995
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.6372
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 11.4940
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.6381
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 1.3645
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.7105
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.4632
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA
## strata(tgroup)tgroup=1:Albumin_min 1.6183
## strata(tgroup)tgroup=2:Albumin_min 1.6492
## strata(tgroup)tgroup=1:Bilirubin_max 0.9611
## strata(tgroup)tgroup=2:Bilirubin_max 0.9604
## strata(tgroup)tgroup=1:GCS_max 1.0915
## strata(tgroup)tgroup=2:GCS_max 0.9976
## strata(tgroup)tgroup=1:HCO3_min 0.9870
## strata(tgroup)tgroup=2:HCO3_min 0.9061
## strata(tgroup)tgroup=1:HR_min 0.9907
## strata(tgroup)tgroup=2:HR_min 1.0104
## strata(tgroup)tgroup=1:Lactate_max 0.9355
## strata(tgroup)tgroup=2:Lactate_max 1.0142
## lower .95 upper .95
## Age 1.01872 1.0440
## BUN_max 1.00443 1.0159
## Na_max 0.93325 1.0106
## pH_min 0.02076 1.0426
## Temp_max 0.80533 1.2922
## Urine_min 0.99417 1.0070
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=1 0.61042 4.0354
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=1 0.01139 0.6644
## ICUTypeMedical ICU:strata(tgroup)tgroup=1 0.88820 2.7647
## ICUTypeSurgical ICU:strata(tgroup)tgroup=1 NA NA
## ICUTypeCoronary Care Unit:strata(tgroup)tgroup=2 0.14706 3.6524
## ICUTypeCardiac Surgery Recovery Unit:strata(tgroup)tgroup=2 0.52617 3.7652
## ICUTypeMedical ICU:strata(tgroup)tgroup=2 0.95872 4.8607
## ICUTypeSurgical ICU:strata(tgroup)tgroup=2 NA NA
## strata(tgroup)tgroup=1:Albumin_min 0.41336 0.9237
## strata(tgroup)tgroup=2:Albumin_min 0.35083 1.0479
## strata(tgroup)tgroup=1:Bilirubin_max 1.00494 1.0773
## strata(tgroup)tgroup=2:Bilirubin_max 0.96268 1.1262
## strata(tgroup)tgroup=1:GCS_max 0.85570 0.9810
## strata(tgroup)tgroup=2:GCS_max 0.91336 1.1002
## strata(tgroup)tgroup=1:HCO3_min 0.96535 1.0634
## strata(tgroup)tgroup=2:HCO3_min 1.04178 1.1693
## strata(tgroup)tgroup=1:HR_min 0.99429 1.0247
## strata(tgroup)tgroup=2:HR_min 0.96813 1.0119
## strata(tgroup)tgroup=1:Lactate_max 0.97981 1.1662
## strata(tgroup)tgroup=2:Lactate_max 0.85168 1.1415
##
## Concordance= 0.756 (se = 0.021 )
## Likelihood ratio test= 106.4 on 24 df, p=2e-12
## Wald test = 94.65 on 24 df, p=2e-10
## Score (logrank) test = 104.6 on 24 df, p=5e-12
In order to fit the final model to the original dataset, we first manually remove the missing data for the variables in the final model, which allows us to split the df0 dataset at the 90 day timepoint - to remain consistent with the dataset used in the final model. As we saw in Task 1, R would have removed the observations with missing data when attempting to fit the model to the original dataset, but here we do this manually to allow the splitting of the dataset to work.
Difference when fitted to dataset without imputed values of missing observations (df0):
pH, Temp_max, ICUType and Albumin which leads to vastly different inferences on the impact of these variables on mortality risk.Summary of findings of the final model:
Our Cox proportional hazards survival model of the icu_patients_df1 dataset is based on initial variables selected due to known association with morbidity and mortality either individually or as part of a validated ICU risk score (SOFA, SAPS1 and APACHE). Based on initial EDA, variables with a large proportion of missing data were excluded from the analysis (Height, NISysABP_min, NISysABP_max).
After analysing a series of fitted Cox proportional hazard models and addressing issues with assumptions, as explained above, we arrive at the final chosen model to predict overall survival in patients who had been admitted to ICU for >48 hours: ICU.final.cox.
Indepth discussion of the hazard rates for individual parameters is outlined above. The final Cox proportional hazards model suggests that in the first 24 hours of ICU admission, age, maximum BUN, maximum sodium, maximum temperature, minimum pH, minimum urine output, as well as ICU type, minimum albumin, minimum bicarbonate (HCO3), minimum heart rate, maximum bilirubin, maximum GCS and maximum lactate when stratified by survival lesser or greater than 90 days, predicts overall survival in adult ICU patients with ICU admissions >48 hours.
Based on our final model, ICU patients who have longer overall survival, in the first 24 hours of ICU admission, had lower age, lower maximum urea, higher maximum sodium, higher minimum pH, higher maximum temperature and higher maximum GCS scores. For patients that did not survive past 90 days, their survival was longer with higher minimum albumin, lower minimum heart rate and lower maximum lactate. For patients who did survive past 90 days, their survival was longer with lower minimum bicarbonate (HCO3) levels. Patients also had longer overall survival in Surgical ICU compared to Medical ICU, and in Cardiac Surgery Recovery Unit compared to Surgical ICU.
Individual predictors that had a large magnitude of effect on survival include age and minimum pH, as well as the stratified variables (by survival more or less than 90 days) of minimum albumin, type of ICU admission and maximum GCS.
Reminder: don’t forget to save this file, to knit it to check that everything works, and then submit via the drop box in OpenLearning.
When you have finished, and are satisfied with your assignment solutions, and this file knits without errors and the output looks the way you want, then you should submit via the drop box in OpenLearning.
If you encounter problems with any part of the process described above, please contact the course convenor via OpenLearning as soon as possible so that the issues can be resolved in good time, and well before the assignment is due.
Each task attracts the indicated number of marks (out of a total of 30 marks for the assignment). The instructions are deliberately open-ended and less prescriptive than the individual assignments to allow you some latitude in what you do and how you go about the task. However, to complete the tasks and gain full marks, you only need to replicate or repeat the steps covered in the course - if you do most or all of the things described in the revalant chapters of the HDAT9600 course, full marks will be awarded.
Note also that with respect to the model fitting, there are no right or wrong answers when it comes to variable selection and other aspects of model specification. Deep understanding of the underlying medical concepts which govern patient treatment and outcomes in ICUs is not required or assumed, although you should try to gain some understanding of each variable using the links provided. You will not be marked down if your medical justifications are not exactly correct or complete, but do you best, and don’t hesitate to seek help from the course convenor.